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
6d07a9c3
Commit
6d07a9c3
authored
Jun 05, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the server part of the ExitThread functionality to ntdll.
parent
a583b257
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
39 deletions
+37
-39
thread.c
dlls/kernel/thread.c
+1
-39
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
server.c
dlls/ntdll/server.c
+34
-0
server.h
include/wine/server.h
+1
-0
No files found.
dlls/kernel/thread.c
View file @
6d07a9c3
...
...
@@ -24,7 +24,6 @@
#include <assert.h>
#include <fcntl.h>
#include <stdarg.h>
#include <signal.h>
#include <sys/types.h>
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
...
...
@@ -238,45 +237,8 @@ void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
}
else
{
struct
wine_pthread_thread_info
info
;
sigset_t
block_set
;
ULONG
size
;
LdrShutdownThread
();
RtlAcquirePebLock
();
RemoveEntryList
(
&
NtCurrentTeb
()
->
TlsLinks
);
RtlReleasePebLock
();
info
.
stack_base
=
NtCurrentTeb
()
->
DeallocationStack
;
info
.
teb_base
=
NtCurrentTeb
();
info
.
teb_sel
=
wine_get_fs
();
info
.
exit_status
=
code
;
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
info
.
stack_base
,
&
size
,
MEM_RELEASE
|
MEM_SYSTEM
);
info
.
stack_size
=
size
;
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
info
.
teb_base
,
&
size
,
MEM_RELEASE
|
MEM_SYSTEM
);
info
.
teb_size
=
size
;
/* block the async signals */
sigemptyset
(
&
block_set
);
sigaddset
(
&
block_set
,
SIGALRM
);
sigaddset
(
&
block_set
,
SIGIO
);
sigaddset
(
&
block_set
,
SIGINT
);
sigaddset
(
&
block_set
,
SIGHUP
);
sigaddset
(
&
block_set
,
SIGUSR1
);
sigaddset
(
&
block_set
,
SIGUSR2
);
sigaddset
(
&
block_set
,
SIGTERM
);
sigprocmask
(
SIG_BLOCK
,
&
block_set
,
NULL
);
close
(
NtCurrentTeb
()
->
wait_fd
[
0
]
);
close
(
NtCurrentTeb
()
->
wait_fd
[
1
]
);
close
(
NtCurrentTeb
()
->
reply_fd
);
close
(
NtCurrentTeb
()
->
request_fd
);
wine_pthread_exit_thread
(
&
info
);
wine_server_exit_thread
(
code
);
}
}
...
...
dlls/ntdll/ntdll.spec
View file @
6d07a9c3
...
...
@@ -1027,6 +1027,7 @@
@ cdecl wine_server_handle_to_fd(long long ptr ptr)
@ cdecl wine_server_release_fd(long long)
@ cdecl wine_server_send_fd(long)
@ cdecl wine_server_exit_thread(long)
# Codepages
@ cdecl __wine_init_codepages(ptr ptr ptr)
...
...
dlls/ntdll/server.c
View file @
6d07a9c3
...
...
@@ -119,6 +119,40 @@ static void fatal_perror( const char *err, ... )
/***********************************************************************
* wine_server_exit_thread (NTDLL.@)
*/
void
wine_server_exit_thread
(
int
status
)
{
struct
wine_pthread_thread_info
info
;
ULONG
size
;
RtlAcquirePebLock
();
RemoveEntryList
(
&
NtCurrentTeb
()
->
TlsLinks
);
RtlReleasePebLock
();
info
.
stack_base
=
NtCurrentTeb
()
->
DeallocationStack
;
info
.
teb_base
=
NtCurrentTeb
();
info
.
teb_sel
=
wine_get_fs
();
info
.
exit_status
=
status
;
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
info
.
stack_base
,
&
size
,
MEM_RELEASE
|
MEM_SYSTEM
);
info
.
stack_size
=
size
;
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
info
.
teb_base
,
&
size
,
MEM_RELEASE
|
MEM_SYSTEM
);
info
.
teb_size
=
size
;
sigprocmask
(
SIG_BLOCK
,
&
block_set
,
NULL
);
close
(
NtCurrentTeb
()
->
wait_fd
[
0
]
);
close
(
NtCurrentTeb
()
->
wait_fd
[
1
]
);
close
(
NtCurrentTeb
()
->
reply_fd
);
close
(
NtCurrentTeb
()
->
request_fd
);
wine_pthread_exit_thread
(
&
info
);
}
/***********************************************************************
* server_abort_thread
*/
void
server_abort_thread
(
int
status
)
...
...
include/wine/server.h
View file @
6d07a9c3
...
...
@@ -55,6 +55,7 @@ extern void wine_server_send_fd( int fd );
extern
int
wine_server_fd_to_handle
(
int
fd
,
unsigned
int
access
,
int
inherit
,
obj_handle_t
*
handle
);
extern
int
wine_server_handle_to_fd
(
obj_handle_t
handle
,
unsigned
int
access
,
int
*
unix_fd
,
int
*
flags
);
extern
void
wine_server_release_fd
(
obj_handle_t
handle
,
int
unix_fd
);
extern
void
DECLSPEC_NORETURN
wine_server_exit_thread
(
int
status
);
/* do a server call and set the last error code */
inline
static
unsigned
int
wine_server_call_err
(
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