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
06105495
Commit
06105495
authored
Jun 18, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move all thread exit processing to exit_thread(), and make RtlExitUserThread() CPU-specific.
parent
f124c7cc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
36 deletions
+56
-36
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
signal_i386.c
dlls/ntdll/signal_i386.c
+8
-1
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+9
-1
signal_sparc.c
dlls/ntdll/signal_sparc.c
+9
-1
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+10
-1
thread.c
dlls/ntdll/thread.c
+19
-32
No files found.
dlls/ntdll/ntdll_misc.h
View file @
06105495
...
@@ -78,6 +78,7 @@ extern size_t server_init_thread( void *entry_point );
...
@@ -78,6 +78,7 @@ extern size_t server_init_thread( void *entry_point );
extern
void
DECLSPEC_NORETURN
server_protocol_error
(
const
char
*
err
,
...
);
extern
void
DECLSPEC_NORETURN
server_protocol_error
(
const
char
*
err
,
...
);
extern
void
DECLSPEC_NORETURN
server_protocol_perror
(
const
char
*
err
);
extern
void
DECLSPEC_NORETURN
server_protocol_perror
(
const
char
*
err
);
extern
void
DECLSPEC_NORETURN
abort_thread
(
int
status
);
extern
void
DECLSPEC_NORETURN
abort_thread
(
int
status
);
extern
void
DECLSPEC_NORETURN
exit_thread
(
int
status
);
extern
sigset_t
server_block_set
;
extern
sigset_t
server_block_set
;
extern
void
server_enter_uninterrupted_section
(
RTL_CRITICAL_SECTION
*
cs
,
sigset_t
*
sigset
);
extern
void
server_enter_uninterrupted_section
(
RTL_CRITICAL_SECTION
*
cs
,
sigset_t
*
sigset
);
extern
void
server_leave_uninterrupted_section
(
RTL_CRITICAL_SECTION
*
cs
,
sigset_t
*
sigset
);
extern
void
server_leave_uninterrupted_section
(
RTL_CRITICAL_SECTION
*
cs
,
sigset_t
*
sigset
);
...
...
dlls/ntdll/signal_i386.c
View file @
06105495
...
@@ -2274,7 +2274,7 @@ __ASM_GLOBAL_FUNC(call_thread_func,
...
@@ -2274,7 +2274,7 @@ __ASM_GLOBAL_FUNC(call_thread_func,
"call *8(%ebp)
\n\t
"
"call *8(%ebp)
\n\t
"
"leal -4(%ebp),%esp
\n\t
"
"leal -4(%ebp),%esp
\n\t
"
"pushl %eax
\n\t
"
"pushl %eax
\n\t
"
"call "
__ASM_NAME
(
"
RtlExitUserT
hread"
)
"
\n\t
"
"call "
__ASM_NAME
(
"
exit_t
hread"
)
"
\n\t
"
"int $3"
)
"int $3"
)
/***********************************************************************
/***********************************************************************
...
@@ -2294,6 +2294,13 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -2294,6 +2294,13 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
abort
();
/* should not be reached */
abort
();
/* should not be reached */
}
}
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
exit_thread
(
status
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
...
...
dlls/ntdll/signal_powerpc.c
View file @
06105495
...
@@ -1093,7 +1093,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -1093,7 +1093,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
{
{
__TRY
__TRY
{
{
RtlExitUserT
hread
(
entry
(
arg
));
exit_t
hread
(
entry
(
arg
));
}
}
__EXCEPT
(
unhandled_exception_filter
)
__EXCEPT
(
unhandled_exception_filter
)
{
{
...
@@ -1103,6 +1103,14 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -1103,6 +1103,14 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
abort
();
/* should not be reached */
abort
();
/* should not be reached */
}
}
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
exit_thread
(
status
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
*/
*/
...
...
dlls/ntdll/signal_sparc.c
View file @
06105495
...
@@ -835,7 +835,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -835,7 +835,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
{
{
__TRY
__TRY
{
{
RtlExitUserT
hread
(
entry
(
arg
));
exit_t
hread
(
entry
(
arg
));
}
}
__EXCEPT
(
unhandled_exception_filter
)
__EXCEPT
(
unhandled_exception_filter
)
{
{
...
@@ -845,6 +845,14 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -845,6 +845,14 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
abort
();
/* should not be reached */
abort
();
/* should not be reached */
}
}
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
exit_thread
(
status
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
*/
*/
...
...
dlls/ntdll/signal_x86_64.c
View file @
06105495
...
@@ -2558,7 +2558,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -2558,7 +2558,7 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
{
{
__TRY
__TRY
{
{
RtlExitUserT
hread
(
entry
(
arg
));
exit_t
hread
(
entry
(
arg
));
}
}
__EXCEPT
(
unhandled_exception_filter
)
__EXCEPT
(
unhandled_exception_filter
)
{
{
...
@@ -2569,6 +2569,15 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
...
@@ -2569,6 +2569,15 @@ void call_thread_entry_point( LPTHREAD_START_ROUTINE entry, void *arg )
}
}
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
exit_thread
(
status
);
}
/**********************************************************************
/**********************************************************************
* __wine_enter_vm86 (NTDLL.@)
* __wine_enter_vm86 (NTDLL.@)
*/
*/
...
...
dlls/ntdll/thread.c
View file @
06105495
...
@@ -353,11 +353,29 @@ void abort_thread( int status )
...
@@ -353,11 +353,29 @@ void abort_thread( int status )
/***********************************************************************
/***********************************************************************
* exit_thread
* exit_thread
*/
*/
static
void
DECLSPEC_NORETURN
exit_thread
(
int
status
)
void
exit_thread
(
int
status
)
{
{
static
void
*
prev_teb
;
static
void
*
prev_teb
;
TEB
*
teb
;
TEB
*
teb
;
if
(
status
)
/* send the exit code to the server (0 is already the default) */
{
SERVER_START_REQ
(
terminate_thread
)
{
req
->
handle
=
wine_server_obj_handle
(
GetCurrentThread
()
);
req
->
exit_code
=
status
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
if
(
interlocked_xchg_add
(
&
nb_threads
,
-
1
)
<=
1
)
{
LdrShutdownProcess
();
exit
(
status
);
}
LdrShutdownThread
();
RtlAcquirePebLock
();
RtlAcquirePebLock
();
RemoveEntryList
(
&
NtCurrentTeb
()
->
TlsLinks
);
RemoveEntryList
(
&
NtCurrentTeb
()
->
TlsLinks
);
RtlReleasePebLock
();
RtlReleasePebLock
();
...
@@ -365,7 +383,6 @@ static void DECLSPEC_NORETURN exit_thread( int status )
...
@@ -365,7 +383,6 @@ static void DECLSPEC_NORETURN exit_thread( int status )
RtlFreeHeap
(
GetProcessHeap
(),
0
,
NtCurrentTeb
()
->
TlsExpansionSlots
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
NtCurrentTeb
()
->
TlsExpansionSlots
);
pthread_sigmask
(
SIG_BLOCK
,
&
server_block_set
,
NULL
);
pthread_sigmask
(
SIG_BLOCK
,
&
server_block_set
,
NULL
);
if
(
interlocked_xchg_add
(
&
nb_threads
,
-
1
)
<=
1
)
exit
(
status
);
if
((
teb
=
interlocked_xchg_ptr
(
&
prev_teb
,
NtCurrentTeb
()
)))
if
((
teb
=
interlocked_xchg_ptr
(
&
prev_teb
,
NtCurrentTeb
()
)))
{
{
...
@@ -567,36 +584,6 @@ error:
...
@@ -567,36 +584,6 @@ error:
/***********************************************************************
/***********************************************************************
* RtlExitUserThread (NTDLL.@)
*/
void
WINAPI
RtlExitUserThread
(
ULONG
status
)
{
BOOL
last
;
SERVER_START_REQ
(
terminate_thread
)
{
/* send the exit code to the server */
req
->
handle
=
wine_server_obj_handle
(
GetCurrentThread
()
);
req
->
exit_code
=
status
;
wine_server_call
(
req
);
last
=
reply
->
last
;
}
SERVER_END_REQ
;
if
(
last
)
{
LdrShutdownProcess
();
exit
(
status
);
}
else
{
LdrShutdownThread
();
exit_thread
(
status
);
}
}
/***********************************************************************
* NtOpenThread (NTDLL.@)
* NtOpenThread (NTDLL.@)
* ZwOpenThread (NTDLL.@)
* ZwOpenThread (NTDLL.@)
*/
*/
...
...
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