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
45c99193
Commit
45c99193
authored
Dec 29, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Make the select cookie a client_ptr_t instead of a void pointer.
parent
93737d55
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
18 deletions
+18
-18
sync.c
dlls/ntdll/sync.c
+2
-2
server_protocol.h
include/wine/server_protocol.h
+3
-3
protocol.def
server/protocol.def
+2
-2
thread.c
server/thread.c
+8
-10
trace.c
server/trace.c
+3
-1
No files found.
dlls/ntdll/sync.c
View file @
45c99193
...
...
@@ -812,7 +812,7 @@ static int wait_reply( void *cookie )
if
(
ret
==
sizeof
(
reply
))
{
if
(
!
reply
.
cookie
)
break
;
/* thread got killed */
if
(
reply
.
cookie
==
cookie
)
return
reply
.
signaled
;
if
(
wine_server_get_ptr
(
reply
.
cookie
)
==
cookie
)
return
reply
.
signaled
;
/* we stole another reply, wait for the real one */
signaled
=
wait_reply
(
cookie
);
/* and now put the wrong one back in the pipe */
...
...
@@ -1091,7 +1091,7 @@ NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UIN
SERVER_START_REQ
(
select
)
{
req
->
flags
=
flags
;
req
->
cookie
=
&
cookie
;
req
->
cookie
=
wine_server_client_ptr
(
&
cookie
)
;
req
->
signal
=
wine_server_obj_handle
(
signal_object
);
req
->
prev_apc
=
apc_handle
;
req
->
timeout
=
abs_timeout
;
...
...
include/wine/server_protocol.h
View file @
45c99193
...
...
@@ -135,7 +135,7 @@ struct send_fd
struct
wake_up_reply
{
void
*
cookie
;
client_ptr_t
cookie
;
int
signaled
;
};
...
...
@@ -860,7 +860,7 @@ struct select_request
{
struct
request_header
__header
;
int
flags
;
void
*
cookie
;
client_ptr_t
cookie
;
obj_handle_t
signal
;
obj_handle_t
prev_apc
;
timeout_t
timeout
;
...
...
@@ -5052,6 +5052,6 @@ union generic_reply
struct
set_window_layered_info_reply
set_window_layered_info_reply
;
};
#define SERVER_PROTOCOL_VERSION 35
8
#define SERVER_PROTOCOL_VERSION 35
9
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
45c99193
...
...
@@ -151,7 +151,7 @@ struct send_fd
/* structure sent by the server on the wait fifo */
struct wake_up_reply
{
void *
cookie; /* magic cookie that was passed in select_request */
client_ptr_t
cookie; /* magic cookie that was passed in select_request */
int signaled; /* wait result */
};
...
...
@@ -748,7 +748,7 @@ typedef union
/* Wait for handles */
@REQ(select)
int flags; /* wait flags (see below) */
void*
cookie; /* magic cookie to return to client */
client_ptr_t
cookie; /* magic cookie to return to client */
obj_handle_t signal; /* object to signal (0 if none) */
obj_handle_t prev_apc; /* handle to previous APC */
timeout_t timeout; /* timeout */
...
...
server/thread.c
View file @
45c99193
...
...
@@ -58,7 +58,7 @@ struct thread_wait
struct
thread
*
thread
;
/* owner thread */
int
count
;
/* count of objects */
int
flags
;
void
*
cookie
;
/* magic cookie to return to client */
client_ptr_t
cookie
;
/* magic cookie to return to client */
timeout_t
timeout
;
struct
timeout_user
*
user
;
struct
wait_queue_entry
queues
[
1
];
...
...
@@ -560,7 +560,7 @@ static int check_wait( struct thread *thread )
}
/* send the wakeup signal to a thread */
static
int
send_thread_wakeup
(
struct
thread
*
thread
,
void
*
cookie
,
int
signaled
)
static
int
send_thread_wakeup
(
struct
thread
*
thread
,
client_ptr_t
cookie
,
int
signaled
)
{
struct
wake_up_reply
reply
;
int
ret
;
...
...
@@ -583,15 +583,14 @@ static int send_thread_wakeup( struct thread *thread, void *cookie, int signaled
int
wake_thread
(
struct
thread
*
thread
)
{
int
signaled
,
count
;
void
*
cookie
;
client_ptr_t
cookie
;
for
(
count
=
0
;
thread
->
wait
;
count
++
)
{
if
((
signaled
=
check_wait
(
thread
))
==
-
1
)
break
;
cookie
=
thread
->
wait
->
cookie
;
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *wakeup* signaled=%d cookie=%p
\n
"
,
thread
->
id
,
signaled
,
cookie
);
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *wakeup* signaled=%d
\n
"
,
thread
->
id
,
signaled
);
end_wait
(
thread
);
if
(
send_thread_wakeup
(
thread
,
cookie
,
signaled
)
==
-
1
)
/* error */
break
;
...
...
@@ -604,14 +603,13 @@ static void thread_timeout( void *ptr )
{
struct
thread_wait
*
wait
=
ptr
;
struct
thread
*
thread
=
wait
->
thread
;
void
*
cookie
=
wait
->
cookie
;
client_ptr_t
cookie
=
wait
->
cookie
;
wait
->
user
=
NULL
;
if
(
thread
->
wait
!=
wait
)
return
;
/* not the top-level wait, ignore it */
if
(
thread
->
suspend
+
thread
->
process
->
suspend
>
0
)
return
;
/* suspended, ignore it */
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *wakeup* signaled=%d cookie=%p
\n
"
,
thread
->
id
,
(
int
)
STATUS_TIMEOUT
,
cookie
);
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *wakeup* signaled=TIMEOUT
\n
"
,
thread
->
id
);
end_wait
(
thread
);
if
(
send_thread_wakeup
(
thread
,
cookie
,
STATUS_TIMEOUT
)
==
-
1
)
return
;
/* check if other objects have become signaled in the meantime */
...
...
@@ -634,7 +632,7 @@ static int signal_object( obj_handle_t handle )
}
/* select on a list of handles */
static
timeout_t
select_on
(
unsigned
int
count
,
void
*
cookie
,
const
obj_handle_t
*
handles
,
static
timeout_t
select_on
(
unsigned
int
count
,
client_ptr_t
cookie
,
const
obj_handle_t
*
handles
,
int
flags
,
timeout_t
timeout
,
obj_handle_t
signal_obj
)
{
int
ret
;
...
...
@@ -916,7 +914,7 @@ void kill_thread( struct thread *thread, int violent_death )
if
(
thread
->
wait
)
{
while
(
thread
->
wait
)
end_wait
(
thread
);
send_thread_wakeup
(
thread
,
NULL
,
STATUS_PENDING
);
send_thread_wakeup
(
thread
,
0
,
STATUS_PENDING
);
/* if it is waiting on the socket, we don't need to send a SIGQUIT */
violent_death
=
0
;
}
...
...
server/trace.c
View file @
45c99193
...
...
@@ -1175,7 +1175,9 @@ static void dump_open_thread_reply( const struct open_thread_reply *req )
static
void
dump_select_request
(
const
struct
select_request
*
req
)
{
fprintf
(
stderr
,
" flags=%d,"
,
req
->
flags
);
fprintf
(
stderr
,
" cookie=%p,"
,
req
->
cookie
);
fprintf
(
stderr
,
" cookie="
);
dump_uint64
(
&
req
->
cookie
);
fprintf
(
stderr
,
","
);
fprintf
(
stderr
,
" signal=%04x,"
,
req
->
signal
);
fprintf
(
stderr
,
" prev_apc=%04x,"
,
req
->
prev_apc
);
fprintf
(
stderr
,
" timeout="
);
...
...
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