Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
42bd67b5
Commit
42bd67b5
authored
May 29, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't call terminate_thread request if not necessary.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
116890da
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
20 deletions
+13
-20
thread.c
dlls/ntdll/thread.c
+10
-8
server_protocol.h
include/wine/server_protocol.h
+2
-2
protocol.def
server/protocol.def
+0
-1
request.h
server/request.h
+0
-1
thread.c
server/thread.c
+1
-7
trace.c
server/trace.c
+0
-1
No files found.
dlls/ntdll/thread.c
View file @
42bd67b5
...
@@ -738,17 +738,19 @@ NTSTATUS WINAPI NtAlertThread( HANDLE handle )
...
@@ -738,17 +738,19 @@ NTSTATUS WINAPI NtAlertThread( HANDLE handle )
NTSTATUS
WINAPI
NtTerminateThread
(
HANDLE
handle
,
LONG
exit_code
)
NTSTATUS
WINAPI
NtTerminateThread
(
HANDLE
handle
,
LONG
exit_code
)
{
{
NTSTATUS
ret
;
NTSTATUS
ret
;
BOOL
self
;
BOOL
self
=
(
handle
==
GetCurrentThread
())
;
SERVER_START_REQ
(
terminate_thread
)
if
(
!
self
||
exit_code
)
{
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
SERVER_START_REQ
(
terminate_thread
)
req
->
exit_code
=
exit_code
;
{
ret
=
wine_server_call
(
req
);
req
->
handle
=
wine_server_obj_handle
(
handle
);
self
=
!
ret
&&
reply
->
self
;
req
->
exit_code
=
exit_code
;
ret
=
wine_server_call
(
req
);
self
=
!
ret
&&
reply
->
self
;
}
SERVER_END_REQ
;
}
}
SERVER_END_REQ
;
if
(
self
)
abort_thread
(
exit_code
);
if
(
self
)
abort_thread
(
exit_code
);
return
ret
;
return
ret
;
}
}
...
...
include/wine/server_protocol.h
View file @
42bd67b5
...
@@ -938,7 +938,7 @@ struct terminate_thread_reply
...
@@ -938,7 +938,7 @@ struct terminate_thread_reply
{
{
struct
reply_header
__header
;
struct
reply_header
__header
;
int
self
;
int
self
;
int
last
;
char
__pad_12
[
4
]
;
};
};
...
@@ -6685,7 +6685,7 @@ union generic_reply
...
@@ -6685,7 +6685,7 @@ union generic_reply
/* ### protocol_version begin ### */
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 60
4
#define SERVER_PROTOCOL_VERSION 60
5
/* ### protocol_version end ### */
/* ### protocol_version end ### */
...
...
server/protocol.def
View file @
42bd67b5
...
@@ -896,7 +896,6 @@ struct rawinput_device
...
@@ -896,7 +896,6 @@ struct rawinput_device
int exit_code; /* thread exit code */
int exit_code; /* thread exit code */
@REPLY
@REPLY
int self; /* suicide? */
int self; /* suicide? */
int last; /* last thread in this process? */
@END
@END
...
...
server/request.h
View file @
42bd67b5
...
@@ -814,7 +814,6 @@ C_ASSERT( FIELD_OFFSET(struct terminate_thread_request, handle) == 12 );
...
@@ -814,7 +814,6 @@ C_ASSERT( FIELD_OFFSET(struct terminate_thread_request, handle) == 12 );
C_ASSERT
(
FIELD_OFFSET
(
struct
terminate_thread_request
,
exit_code
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
terminate_thread_request
,
exit_code
)
==
16
);
C_ASSERT
(
sizeof
(
struct
terminate_thread_request
)
==
24
);
C_ASSERT
(
sizeof
(
struct
terminate_thread_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
terminate_thread_reply
,
self
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
terminate_thread_reply
,
self
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
terminate_thread_reply
,
last
)
==
12
);
C_ASSERT
(
sizeof
(
struct
terminate_thread_reply
)
==
16
);
C_ASSERT
(
sizeof
(
struct
terminate_thread_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_process_info_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_process_info_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_process_info_request
)
==
16
);
C_ASSERT
(
sizeof
(
struct
get_process_info_request
)
==
16
);
...
...
server/thread.c
View file @
42bd67b5
...
@@ -1489,17 +1489,11 @@ DECL_HANDLER(terminate_thread)
...
@@ -1489,17 +1489,11 @@ DECL_HANDLER(terminate_thread)
{
{
struct
thread
*
thread
;
struct
thread
*
thread
;
reply
->
self
=
0
;
reply
->
last
=
0
;
if
((
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_TERMINATE
)))
if
((
thread
=
get_thread_from_handle
(
req
->
handle
,
THREAD_TERMINATE
)))
{
{
thread
->
exit_code
=
req
->
exit_code
;
thread
->
exit_code
=
req
->
exit_code
;
if
(
thread
!=
current
)
kill_thread
(
thread
,
1
);
if
(
thread
!=
current
)
kill_thread
(
thread
,
1
);
else
else
reply
->
self
=
1
;
{
reply
->
self
=
1
;
reply
->
last
=
(
thread
->
process
->
running_threads
==
1
);
}
release_object
(
thread
);
release_object
(
thread
);
}
}
}
}
...
...
server/trace.c
View file @
42bd67b5
...
@@ -1368,7 +1368,6 @@ static void dump_terminate_thread_request( const struct terminate_thread_request
...
@@ -1368,7 +1368,6 @@ static void dump_terminate_thread_request( const struct terminate_thread_request
static
void
dump_terminate_thread_reply
(
const
struct
terminate_thread_reply
*
req
)
static
void
dump_terminate_thread_reply
(
const
struct
terminate_thread_reply
*
req
)
{
{
fprintf
(
stderr
,
" self=%d"
,
req
->
self
);
fprintf
(
stderr
,
" self=%d"
,
req
->
self
);
fprintf
(
stderr
,
", last=%d"
,
req
->
last
);
}
}
static
void
dump_get_process_info_request
(
const
struct
get_process_info_request
*
req
)
static
void
dump_get_process_info_request
(
const
struct
get_process_info_request
*
req
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment