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
93eceba0
Commit
93eceba0
authored
Nov 29, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move freeing the thread stack to a common helper.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6f790606
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
38 deletions
+24
-38
signal_arm.c
dlls/ntdll/signal_arm.c
+1
-7
signal_arm64.c
dlls/ntdll/signal_arm64.c
+1
-7
signal_i386.c
dlls/ntdll/signal_i386.c
+2
-8
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+1
-7
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+1
-7
thread.c
dlls/ntdll/thread.c
+18
-2
No files found.
dlls/ntdll/signal_arm.c
View file @
93eceba0
...
@@ -944,14 +944,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
...
@@ -944,14 +944,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*/
*/
void
signal_free_thread
(
TEB
*
teb
)
void
signal_free_thread
(
TEB
*
teb
)
{
{
SIZE_T
size
;
SIZE_T
size
=
0
;
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
}
}
...
...
dlls/ntdll/signal_arm64.c
View file @
93eceba0
...
@@ -817,14 +817,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
...
@@ -817,14 +817,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*/
*/
void
signal_free_thread
(
TEB
*
teb
)
void
signal_free_thread
(
TEB
*
teb
)
{
{
SIZE_T
size
;
SIZE_T
size
=
0
;
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
}
}
...
...
dlls/ntdll/signal_i386.c
View file @
93eceba0
...
@@ -2504,16 +2504,10 @@ NTSTATUS signal_alloc_thread( TEB **teb )
...
@@ -2504,16 +2504,10 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*/
*/
void
signal_free_thread
(
TEB
*
teb
)
void
signal_free_thread
(
TEB
*
teb
)
{
{
SIZE_T
size
;
SIZE_T
size
=
0
;
struct
x86_thread_data
*
thread_data
=
(
struct
x86_thread_data
*
)
teb
->
SystemReserved2
;
struct
x86_thread_data
*
thread_data
=
(
struct
x86_thread_data
*
)
teb
->
SystemReserved2
;
if
(
thread_data
)
wine_ldt_free_fs
(
thread_data
->
fs
);
wine_ldt_free_fs
(
thread_data
->
fs
);
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
}
}
...
...
dlls/ntdll/signal_powerpc.c
View file @
93eceba0
...
@@ -1023,14 +1023,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
...
@@ -1023,14 +1023,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*/
*/
void
signal_free_thread
(
TEB
*
teb
)
void
signal_free_thread
(
TEB
*
teb
)
{
{
SIZE_T
size
;
SIZE_T
size
=
0
;
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
}
}
...
...
dlls/ntdll/signal_x86_64.c
View file @
93eceba0
...
@@ -2983,14 +2983,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
...
@@ -2983,14 +2983,8 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*/
*/
void
signal_free_thread
(
TEB
*
teb
)
void
signal_free_thread
(
TEB
*
teb
)
{
{
SIZE_T
size
;
SIZE_T
size
=
0
;
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
size
=
0
;
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
teb
,
&
size
,
MEM_RELEASE
);
}
}
...
...
dlls/ntdll/thread.c
View file @
93eceba0
...
@@ -404,6 +404,22 @@ HANDLE thread_init(void)
...
@@ -404,6 +404,22 @@ HANDLE thread_init(void)
/***********************************************************************
/***********************************************************************
* free_thread_data
*/
static
void
free_thread_data
(
TEB
*
teb
)
{
SIZE_T
size
;
if
(
teb
->
DeallocationStack
)
{
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
teb
->
DeallocationStack
,
&
size
,
MEM_RELEASE
);
}
signal_free_thread
(
teb
);
}
/***********************************************************************
* terminate_thread
* terminate_thread
*/
*/
void
terminate_thread
(
int
status
)
void
terminate_thread
(
int
status
)
...
@@ -456,7 +472,7 @@ void exit_thread( int status )
...
@@ -456,7 +472,7 @@ void exit_thread( int status )
if
(
thread_data
->
pthread_id
)
if
(
thread_data
->
pthread_id
)
{
{
pthread_join
(
thread_data
->
pthread_id
,
NULL
);
pthread_join
(
thread_data
->
pthread_id
,
NULL
);
signal_free_thread
(
teb
);
free_thread_data
(
teb
);
}
}
}
}
...
@@ -634,7 +650,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
...
@@ -634,7 +650,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
error:
error:
if
(
teb
)
signal_free_thread
(
teb
);
if
(
teb
)
free_thread_data
(
teb
);
if
(
handle
)
NtClose
(
handle
);
if
(
handle
)
NtClose
(
handle
);
pthread_sigmask
(
SIG_SETMASK
,
&
sigset
,
NULL
);
pthread_sigmask
(
SIG_SETMASK
,
&
sigset
,
NULL
);
close
(
request_pipe
[
1
]
);
close
(
request_pipe
[
1
]
);
...
...
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