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
31741747
Commit
31741747
authored
Mar 28, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put CLONE_FILES back in, it is still breaking too many things.
parent
a08e2cf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
20 deletions
+11
-20
sysdeps.c
scheduler/sysdeps.c
+10
-20
thread.c
scheduler/thread.c
+1
-0
No files found.
scheduler/sysdeps.c
View file @
31741747
...
@@ -49,13 +49,8 @@ CRITICAL_SECTION X11DRV_CritSection = { 0, };
...
@@ -49,13 +49,8 @@ CRITICAL_SECTION X11DRV_CritSection = { 0, };
# define CLONE_SIGHAND 0x00000800
# define CLONE_SIGHAND 0x00000800
# define CLONE_PID 0x00001000
# define CLONE_PID 0x00001000
# endif
/* CLONE_VM */
# endif
/* CLONE_VM */
# define PER_THREAD_FILE_HANDLES
#endif
/* linux */
#endif
/* linux */
#ifdef HAVE_RFORK
# define PER_THREAD_FILE_HANDLES
#endif
static
int
init_done
;
static
int
init_done
;
#ifndef NO_REENTRANT_LIBC
#ifndef NO_REENTRANT_LIBC
...
@@ -130,12 +125,7 @@ void SYSDEPS_SetCurThread( TEB *teb )
...
@@ -130,12 +125,7 @@ void SYSDEPS_SetCurThread( TEB *teb )
*/
*/
static
void
SYSDEPS_StartThread
(
TEB
*
teb
)
static
void
SYSDEPS_StartThread
(
TEB
*
teb
)
{
{
int
parent_socket
=
-
1
;
#ifdef PER_THREAD_FILE_HANDLES
parent_socket
=
NtCurrentTeb
()
->
socket
;
#endif
SYSDEPS_SetCurThread
(
teb
);
SYSDEPS_SetCurThread
(
teb
);
if
(
parent_socket
!=
-
1
)
close
(
parent_socket
);
CLIENT_InitThread
();
CLIENT_InitThread
();
SIGNAL_Init
();
SIGNAL_Init
();
__TRY
__TRY
...
@@ -162,20 +152,21 @@ int SYSDEPS_SpawnThread( TEB *teb )
...
@@ -162,20 +152,21 @@ int SYSDEPS_SpawnThread( TEB *teb )
#ifndef NO_REENTRANT_LIBC
#ifndef NO_REENTRANT_LIBC
#ifdef linux
#ifdef linux
if
(
clone
(
(
int
(
*
)(
void
*
))
SYSDEPS_StartThread
,
teb
->
stack_top
,
const
int
flags
=
CLONE_VM
|
CLONE_FS
|
CLONE_FILES
|
SIGCHLD
;
CLONE_VM
|
CLONE_FS
|
SIGCHLD
,
teb
)
<
0
)
if
(
clone
(
(
int
(
*
)(
void
*
))
SYSDEPS_StartThread
,
teb
->
stack_top
,
flags
,
teb
)
<
0
)
return
-
1
;
return
-
1
;
close
(
teb
->
socket
);
/* close the child socket in the parent */
if
(
!
(
flags
&
CLONE_FILES
))
close
(
teb
->
socket
);
/* close the child socket in the parent */
return
0
;
return
0
;
#endif
#endif
#ifdef HAVE_RFORK
#ifdef HAVE_RFORK
const
int
flags
=
RFPROC
|
RFMEM
;
/*|RFFDG*/
void
**
sp
=
(
void
**
)
teb
->
stack_top
;
void
**
sp
=
(
void
**
)
teb
->
stack_top
;
*--
sp
=
teb
;
*--
sp
=
teb
;
*--
sp
=
0
;
*--
sp
=
0
;
*--
sp
=
SYSDEPS_StartThread
;
*--
sp
=
SYSDEPS_StartThread
;
__asm__
__volatile__
(
__asm__
__volatile__
(
"pushl %2;
\n\t
"
/*
RFPROC|RFMEM|RFFDG
*/
"pushl %2;
\n\t
"
/*
flags
*/
"pushl $0;
\n\t
"
/* 0 ? */
"pushl $0;
\n\t
"
/* 0 ? */
"movl %1,%%eax;
\n\t
"
/* SYS_rfork */
"movl %1,%%eax;
\n\t
"
/* SYS_rfork */
".byte 0x9a; .long 0; .word 7;
\n\t
"
/* lcall 7:0... FreeBSD syscall */
".byte 0x9a; .long 0; .word 7;
\n\t
"
/* lcall 7:0... FreeBSD syscall */
...
@@ -185,9 +176,9 @@ int SYSDEPS_SpawnThread( TEB *teb )
...
@@ -185,9 +176,9 @@ int SYSDEPS_SpawnThread( TEB *teb )
"ret;
\n
"
"ret;
\n
"
"1:
\n\t
"
/* parent -> caller thread */
"1:
\n\t
"
/* parent -> caller thread */
"addl $8,%%esp"
:
"addl $8,%%esp"
:
:
"r"
(
sp
),
"g"
(
SYS_rfork
),
"g"
(
RFPROC
|
RFMEM
|
RFFDG
)
:
"r"
(
sp
),
"g"
(
SYS_rfork
),
"g"
(
flags
)
:
"eax"
,
"edx"
);
:
"eax"
,
"edx"
);
close
(
teb
->
socket
);
/* close the child socket in the parent */
if
(
flags
&
RFFDG
)
close
(
teb
->
socket
);
/* close the child socket in the parent */
return
0
;
return
0
;
#endif
#endif
...
@@ -215,10 +206,9 @@ int SYSDEPS_SpawnThread( TEB *teb )
...
@@ -215,10 +206,9 @@ int SYSDEPS_SpawnThread( TEB *teb )
*/
*/
void
SYSDEPS_ExitThread
(
int
status
)
void
SYSDEPS_ExitThread
(
int
status
)
{
{
#ifndef PER_THREAD_FILE_HANDLES
int
socket
=
NtCurrentTeb
()
->
socket
;
/* otherwise it will be closed automagically by _exit */
NtCurrentTeb
()
->
socket
=
-
1
;
close
(
NtCurrentTeb
()
->
socket
);
close
(
socket
);
#endif
#ifdef HAVE__LWP_CREATE
#ifdef HAVE__LWP_CREATE
_lwp_exit
();
_lwp_exit
();
#endif
#endif
...
...
scheduler/thread.c
View file @
31741747
...
@@ -143,6 +143,7 @@ void CALLBACK THREAD_FreeTEB( ULONG_PTR arg )
...
@@ -143,6 +143,7 @@ void CALLBACK THREAD_FreeTEB( ULONG_PTR arg )
/* Free the associated memory */
/* Free the associated memory */
if
(
teb
->
socket
!=
-
1
)
close
(
teb
->
socket
);
if
(
teb
->
stack_sel
)
SELECTOR_FreeBlock
(
teb
->
stack_sel
,
1
);
if
(
teb
->
stack_sel
)
SELECTOR_FreeBlock
(
teb
->
stack_sel
,
1
);
SELECTOR_FreeBlock
(
teb
->
teb_sel
,
1
);
SELECTOR_FreeBlock
(
teb
->
teb_sel
,
1
);
if
(
teb
->
buffer
)
munmap
(
teb
->
buffer
,
teb
->
buffer_size
);
if
(
teb
->
buffer
)
munmap
(
teb
->
buffer
,
teb
->
buffer_size
);
...
...
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