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
f1d40d48
Commit
f1d40d48
authored
Jun 03, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move more of the thread exit code to the Unix library.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
35b063a4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
22 deletions
+17
-22
thread.c
dlls/ntdll/thread.c
+0
-17
loader.c
dlls/ntdll/unix/loader.c
+0
-1
thread.c
dlls/ntdll/unix/thread.c
+14
-0
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-1
virtual.c
dlls/ntdll/unix/virtual.c
+1
-1
unixlib.h
dlls/ntdll/unixlib.h
+1
-2
No files found.
dlls/ntdll/thread.c
View file @
f1d40d48
...
...
@@ -284,9 +284,6 @@ TEB *thread_init(void)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
static
void
*
prev_teb
;
TEB
*
teb
;
if
(
status
)
/* send the exit code to the server (0 is already the default) */
{
SERVER_START_REQ
(
terminate_thread
)
...
...
@@ -306,20 +303,6 @@ void WINAPI RtlExitUserThread( ULONG status )
LdrShutdownThread
();
RtlFreeThreadActivationContextStack
();
pthread_sigmask
(
SIG_BLOCK
,
&
server_block_set
,
NULL
);
if
((
teb
=
InterlockedExchangePointer
(
&
prev_teb
,
NtCurrentTeb
()
)))
{
struct
ntdll_thread_data
*
thread_data
=
(
struct
ntdll_thread_data
*
)
&
teb
->
GdiTebBatch
;
if
(
thread_data
->
pthread_id
)
{
pthread_join
(
thread_data
->
pthread_id
,
NULL
);
unix_funcs
->
virtual_free_teb
(
teb
);
}
}
for
(;;)
unix_funcs
->
exit_thread
(
status
);
}
...
...
dlls/ntdll/unix/loader.c
View file @
f1d40d48
...
...
@@ -1017,7 +1017,6 @@ static struct unix_funcs unix_funcs =
virtual_get_system_info
,
virtual_create_builtin_view
,
virtual_alloc_first_teb
,
virtual_free_teb
,
virtual_alloc_thread_stack
,
virtual_handle_fault
,
virtual_locked_server_call
,
...
...
dlls/ntdll/unix/thread.c
View file @
f1d40d48
...
...
@@ -218,7 +218,21 @@ void CDECL abort_thread( int status )
*/
void
CDECL
exit_thread
(
int
status
)
{
static
void
*
prev_teb
;
TEB
*
teb
;
pthread_sigmask
(
SIG_BLOCK
,
&
server_block_set
,
NULL
);
if
((
teb
=
InterlockedExchangePointer
(
&
prev_teb
,
NtCurrentTeb
()
)))
{
struct
ntdll_thread_data
*
thread_data
=
(
struct
ntdll_thread_data
*
)
&
teb
->
GdiTebBatch
;
if
(
thread_data
->
pthread_id
)
{
pthread_join
(
thread_data
->
pthread_id
,
NULL
);
virtual_free_teb
(
teb
);
}
}
signal_exit_thread
(
status
,
pthread_exit_wrapper
);
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
f1d40d48
...
...
@@ -63,7 +63,6 @@ extern NTSTATUS CDECL virtual_map_section( HANDLE handle, PVOID *addr_ptr, unsig
extern
void
CDECL
virtual_get_system_info
(
SYSTEM_BASIC_INFORMATION
*
info
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
virtual_create_builtin_view
(
void
*
module
)
DECLSPEC_HIDDEN
;
extern
TEB
*
CDECL
virtual_alloc_first_teb
(
void
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
virtual_free_teb
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
virtual_alloc_thread_stack
(
INITIAL_TEB
*
stack
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
,
SIZE_T
*
pthread_size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
,
BOOL
on_signal_stack
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
CDECL
virtual_locked_server_call
(
void
*
req_ptr
)
DECLSPEC_HIDDEN
;
...
...
@@ -134,6 +133,7 @@ extern NTSTATUS set_thread_context( HANDLE handle, const context_t *context, BOO
extern
NTSTATUS
get_thread_context
(
HANDLE
handle
,
context_t
*
context
,
unsigned
int
flags
,
BOOL
*
self
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_alloc_teb
(
TEB
**
ret_teb
)
DECLSPEC_HIDDEN
;
extern
void
virtual_free_teb
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_threading
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
signal_alloc_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unix/virtual.c
View file @
f1d40d48
...
...
@@ -2628,7 +2628,7 @@ NTSTATUS virtual_alloc_teb( TEB **ret_teb )
/***********************************************************************
* virtual_free_teb
*/
void
CDECL
virtual_free_teb
(
TEB
*
teb
)
void
virtual_free_teb
(
TEB
*
teb
)
{
struct
ntdll_thread_data
*
thread_data
=
(
struct
ntdll_thread_data
*
)
&
teb
->
GdiTebBatch
;
SIZE_T
size
;
...
...
dlls/ntdll/unixlib.h
View file @
f1d40d48
...
...
@@ -28,7 +28,7 @@ struct ldt_copy;
struct
msghdr
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 1
8
#define NTDLL_UNIXLIB_VERSION 1
9
struct
unix_funcs
{
...
...
@@ -92,7 +92,6 @@ struct unix_funcs
void
(
CDECL
*
virtual_get_system_info
)(
SYSTEM_BASIC_INFORMATION
*
info
);
NTSTATUS
(
CDECL
*
virtual_create_builtin_view
)(
void
*
module
);
TEB
*
(
CDECL
*
virtual_alloc_first_teb
)(
void
);
void
(
CDECL
*
virtual_free_teb
)(
TEB
*
teb
);
NTSTATUS
(
CDECL
*
virtual_alloc_thread_stack
)(
INITIAL_TEB
*
stack
,
SIZE_T
reserve_size
,
SIZE_T
commit_size
,
SIZE_T
*
pthread_size
);
NTSTATUS
(
CDECL
*
virtual_handle_fault
)(
LPCVOID
addr
,
DWORD
err
,
BOOL
on_signal_stack
);
unsigned
int
(
CDECL
*
virtual_locked_server_call
)(
void
*
req_ptr
);
...
...
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