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
2f2898b5
Commit
2f2898b5
authored
Mar 16, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Mar 16, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle suspend/resume_thread requests in phase STARTING correctly.
Set initial suspend count for threads created with CREATE_SUSPENDED. Set 'inheritable' flag for process/thread handles.
parent
3480e4a5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
12 deletions
+31
-12
server.h
include/server.h
+6
-1
thread.h
include/server/thread.h
+3
-2
client.c
scheduler/client.c
+6
-1
request.c
server/request.c
+6
-2
thread.c
server/thread.c
+6
-5
trace.c
server/trace.c
+4
-1
No files found.
include/server.h
View file @
2f2898b5
...
...
@@ -44,6 +44,9 @@ struct cmsg_fd
struct
new_thread_request
{
void
*
pid
;
/* process id for the new thread (or 0 if none yet) */
int
suspend
;
/* new thread should be suspended on creation */
int
tinherit
;
/* inherit flag for thread handle */
int
pinherit
;
/* inherit flag for process handle */
};
struct
new_thread_reply
{
...
...
@@ -656,7 +659,9 @@ extern unsigned int CLIENT_WaitReply( int *len, int *passed_fd,
extern
unsigned
int
CLIENT_WaitSimpleReply
(
void
*
reply
,
int
len
,
int
*
passed_fd
);
struct
_THDB
;
extern
int
CLIENT_NewThread
(
struct
_THDB
*
thdb
,
int
*
thandle
,
int
*
phandle
);
extern
int
CLIENT_NewThread
(
struct
_THDB
*
thdb
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
int
*
thandle
,
int
*
phandle
);
extern
int
CLIENT_SetDebug
(
int
level
);
extern
int
CLIENT_InitThread
(
void
);
#endif
/* __WINE_SERVER__ */
...
...
include/server/thread.h
View file @
2f2898b5
...
...
@@ -50,8 +50,9 @@ extern struct thread *current;
/* thread functions */
extern
struct
thread
*
create_thread
(
int
fd
,
void
*
pid
,
int
*
thread_handle
,
int
*
process_handle
);
extern
struct
thread
*
create_thread
(
int
fd
,
void
*
pid
,
int
suspend
,
int
thread_inherit
,
int
process_inherit
,
int
*
thread_handle
,
int
*
process_handle
);
extern
struct
thread
*
get_thread_from_id
(
void
*
id
);
extern
struct
thread
*
get_thread_from_handle
(
int
handle
,
unsigned
int
access
);
extern
void
get_thread_info
(
struct
thread
*
thread
,
...
...
scheduler/client.c
View file @
2f2898b5
...
...
@@ -276,7 +276,9 @@ unsigned int CLIENT_WaitSimpleReply( void *reply, int len, int *passed_fd )
*
* Send a new thread request.
*/
int
CLIENT_NewThread
(
THDB
*
thdb
,
int
*
thandle
,
int
*
phandle
)
int
CLIENT_NewThread
(
THDB
*
thdb
,
LPSECURITY_ATTRIBUTES
psa
,
LPSECURITY_ATTRIBUTES
tsa
,
int
*
thandle
,
int
*
phandle
)
{
struct
new_thread_request
request
;
struct
new_thread_reply
reply
;
...
...
@@ -289,6 +291,9 @@ int CLIENT_NewThread( THDB *thdb, int *thandle, int *phandle )
}
request
.
pid
=
thdb
->
process
->
server_pid
;
request
.
suspend
=
(
thdb
->
flags
&
CREATE_SUSPENDED
)
?
TRUE
:
FALSE
;
request
.
tinherit
=
(
tsa
&&
(
tsa
->
nLength
>=
sizeof
(
*
tsa
))
&&
tsa
->
bInheritHandle
);
request
.
pinherit
=
(
psa
&&
(
psa
->
nLength
>=
sizeof
(
*
psa
))
&&
psa
->
bInheritHandle
);
CLIENT_SendRequest
(
REQ_NEW_THREAD
,
fd
[
1
],
1
,
&
request
,
sizeof
(
request
)
);
if
(
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
))
goto
error
;
thdb
->
server_tid
=
reply
.
tid
;
...
...
server/request.c
View file @
2f2898b5
...
...
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
...
...
@@ -113,8 +114,9 @@ DECL_HANDLER(new_thread)
err
=
ERROR_TOO_MANY_OPEN_FILES
;
goto
done
;
}
if
(
!
(
new_thread
=
create_thread
(
new_fd
,
req
->
pid
,
&
reply
.
thandle
,
&
reply
.
phandle
)))
if
(
!
(
new_thread
=
create_thread
(
new_fd
,
req
->
pid
,
req
->
suspend
,
req
->
tinherit
,
req
->
pinherit
,
&
reply
.
thandle
,
&
reply
.
phandle
)))
{
close
(
new_fd
);
err
=
ERROR_OUTOFMEMORY
;
...
...
@@ -153,6 +155,8 @@ DECL_HANDLER(init_thread)
current
->
name
[
len
]
=
'\0'
;
CLEAR_ERROR
();
done
:
if
(
current
->
suspend
>
0
&&
current
->
unix_pid
)
kill
(
current
->
unix_pid
,
SIGSTOP
);
send_reply
(
current
,
-
1
,
0
);
}
...
...
server/thread.c
View file @
2f2898b5
...
...
@@ -75,8 +75,9 @@ static struct thread *first_thread;
/* create a new thread */
struct
thread
*
create_thread
(
int
fd
,
void
*
pid
,
int
*
thread_handle
,
int
*
process_handle
)
struct
thread
*
create_thread
(
int
fd
,
void
*
pid
,
int
suspend
,
int
thread_inherit
,
int
process_inherit
,
int
*
thread_handle
,
int
*
process_handle
)
{
struct
thread
*
thread
;
struct
process
*
process
;
...
...
@@ -107,7 +108,7 @@ struct thread *create_thread( int fd, void *pid, int *thread_handle,
thread
->
prev
=
NULL
;
thread
->
priority
=
THREAD_PRIORITY_NORMAL
;
thread
->
affinity
=
1
;
thread
->
suspend
=
0
;
thread
->
suspend
=
suspend
?
1
:
0
;
if
(
first_thread
)
first_thread
->
prev
=
thread
;
first_thread
=
thread
;
...
...
@@ -117,13 +118,13 @@ struct thread *create_thread( int fd, void *pid, int *thread_handle,
if
(
current
)
{
if
((
*
thread_handle
=
alloc_handle
(
current
->
process
,
thread
,
THREAD_ALL_ACCESS
,
0
))
==
-
1
)
THREAD_ALL_ACCESS
,
thread_inherit
))
==
-
1
)
goto
error
;
}
if
(
current
&&
!
pid
)
{
if
((
*
process_handle
=
alloc_handle
(
current
->
process
,
process
,
PROCESS_ALL_ACCESS
,
0
))
==
-
1
)
PROCESS_ALL_ACCESS
,
process_inherit
))
==
-
1
)
goto
error
;
}
...
...
server/trace.c
View file @
2f2898b5
...
...
@@ -8,7 +8,10 @@
static
int
dump_new_thread_request
(
struct
new_thread_request
*
req
,
int
len
)
{
fprintf
(
stderr
,
" pid=%p"
,
req
->
pid
);
fprintf
(
stderr
,
" pid=%p,"
,
req
->
pid
);
fprintf
(
stderr
,
" suspend=%d,"
,
req
->
suspend
);
fprintf
(
stderr
,
" tinherit=%d,"
,
req
->
tinherit
);
fprintf
(
stderr
,
" pinherit=%d"
,
req
->
pinherit
);
return
(
int
)
sizeof
(
*
req
);
}
...
...
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