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
875c4b3c
Commit
875c4b3c
authored
Mar 23, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added server pid and tid in init_thread request, and use them in
CLIENT_InitThread.
parent
ed494ec5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
14 deletions
+31
-14
server.h
include/server.h
+5
-0
client.c
scheduler/client.c
+10
-4
process.c
scheduler/process.c
+0
-3
sysdeps.c
scheduler/sysdeps.c
+1
-5
thread.c
scheduler/thread.c
+2
-0
request.c
server/request.c
+5
-1
trace.c
server/trace.c
+8
-1
No files found.
include/server.h
View file @
875c4b3c
...
...
@@ -97,6 +97,11 @@ struct init_thread_request
{
int
unix_pid
;
/* Unix pid of new thread */
};
struct
init_thread_reply
{
void
*
pid
;
/* process id of the new thread's process */
void
*
tid
;
/* thread id of the new thread */
};
/* Terminate a process */
...
...
scheduler/client.c
View file @
875c4b3c
...
...
@@ -318,10 +318,16 @@ int CLIENT_InitServer(void)
*/
int
CLIENT_InitThread
(
void
)
{
struct
init_thread_request
init
;
init
.
unix_pid
=
getpid
();
CLIENT_SendRequest
(
REQ_INIT_THREAD
,
-
1
,
1
,
&
init
,
sizeof
(
init
)
);
return
CLIENT_WaitReply
(
NULL
,
NULL
,
0
);
THDB
*
thdb
=
THREAD_Current
();
struct
init_thread_request
req
;
struct
init_thread_reply
reply
;
req
.
unix_pid
=
getpid
();
CLIENT_SendRequest
(
REQ_INIT_THREAD
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
if
(
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
))
return
-
1
;
thdb
->
process
->
server_pid
=
reply
.
pid
;
thdb
->
server_tid
=
reply
.
tid
;
return
0
;
}
...
...
scheduler/process.c
View file @
875c4b3c
...
...
@@ -306,9 +306,6 @@ BOOL PROCESS_Init(void)
/* Create the environment DB of the first process */
if
(
!
PROCESS_BuildEnvDB
(
&
initial_pdb
))
return
FALSE
;
/* Initialize the first thread */
if
(
CLIENT_InitThread
())
return
FALSE
;
/* Create the SEGPTR heap */
if
(
!
(
SegptrHeap
=
HeapCreate
(
HEAP_WINE_SEGPTR
,
0
,
0
)))
return
FALSE
;
...
...
scheduler/sysdeps.c
View file @
875c4b3c
...
...
@@ -80,12 +80,8 @@ int *__h_errno_location()
*/
static
void
SYSDEPS_StartThread
(
THDB
*
thdb
)
{
struct
init_thread_request
init
;
SET_CUR_THREAD
(
thdb
);
init
.
unix_pid
=
getpid
();
CLIENT_SendRequest
(
REQ_INIT_THREAD
,
-
1
,
1
,
&
init
,
sizeof
(
init
)
);
CLIENT_WaitReply
(
NULL
,
NULL
,
0
);
CLIENT_InitThread
();
thdb
->
startup
();
_exit
(
0
);
/* should never get here */
}
...
...
scheduler/thread.c
View file @
875c4b3c
...
...
@@ -201,6 +201,7 @@ THDB *THREAD_CreateInitialThread( PDB *pdb, int server_fd )
/* Now proceed with normal initialization */
if
(
CLIENT_InitThread
())
return
NULL
;
if
(
!
THREAD_InitTHDB
(
&
initial_thdb
,
0
,
TRUE
,
NULL
))
return
NULL
;
return
&
initial_thdb
;
}
...
...
@@ -344,6 +345,7 @@ DWORD WINAPI GetCurrentThreadId(void)
{
THDB
*
thdb
=
THREAD_Current
();
assert
(
thdb
);
assert
(
thdb
->
server_tid
);
return
(
DWORD
)
thdb
->
server_tid
;
}
...
...
server/request.c
View file @
875c4b3c
...
...
@@ -160,6 +160,8 @@ DECL_HANDLER(init_process)
/* initialize a new thread */
DECL_HANDLER
(
init_thread
)
{
struct
init_thread_reply
reply
;
if
(
current
->
state
!=
STARTING
)
{
fatal_protocol_error
(
"init_thread: already running
\n
"
);
...
...
@@ -169,7 +171,9 @@ DECL_HANDLER(init_thread)
current
->
unix_pid
=
req
->
unix_pid
;
if
(
current
->
suspend
>
0
)
kill
(
current
->
unix_pid
,
SIGSTOP
);
send_reply
(
current
,
-
1
,
0
);
reply
.
pid
=
current
->
process
;
reply
.
tid
=
current
;
send_reply
(
current
,
-
1
,
1
,
&
reply
,
sizeof
(
reply
)
);
}
/* set the debug level */
...
...
server/trace.c
View file @
875c4b3c
...
...
@@ -66,6 +66,13 @@ static int dump_init_thread_request( struct init_thread_request *req, int len )
return
(
int
)
sizeof
(
*
req
);
}
static
int
dump_init_thread_reply
(
struct
init_thread_reply
*
req
,
int
len
)
{
fprintf
(
stderr
,
" pid=%p,"
,
req
->
pid
);
fprintf
(
stderr
,
" tid=%p"
,
req
->
tid
);
return
(
int
)
sizeof
(
*
req
);
}
static
int
dump_terminate_process_request
(
struct
terminate_process_request
*
req
,
int
len
)
{
fprintf
(
stderr
,
" handle=%d,"
,
req
->
handle
);
...
...
@@ -638,7 +645,7 @@ static const struct dumper dumpers[REQ_NB_REQUESTS] =
{
(
int
(
*
)(
void
*
,
int
))
dump_init_process_request
,
(
void
(
*
)())
dump_init_process_reply
},
{
(
int
(
*
)(
void
*
,
int
))
dump_init_thread_request
,
(
void
(
*
)())
0
},
(
void
(
*
)())
dump_init_thread_reply
},
{
(
int
(
*
)(
void
*
,
int
))
dump_terminate_process_request
,
(
void
(
*
)())
0
},
{
(
int
(
*
)(
void
*
,
int
))
dump_terminate_thread_request
,
...
...
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