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
042e0046
Commit
042e0046
authored
Aug 22, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Make select on all handles a separate operation.
parent
cbdc0ec7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
16 deletions
+20
-16
sync.c
dlls/ntdll/sync.c
+1
-2
server_protocol.h
include/wine/server_protocol.h
+5
-5
protocol.def
server/protocol.def
+5
-5
thread.c
server/thread.c
+7
-3
trace.c
server/trace.c
+2
-1
No files found.
dlls/ntdll/sync.c
View file @
042e0046
...
...
@@ -1173,9 +1173,8 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles,
if
(
!
count
||
count
>
MAXIMUM_WAIT_OBJECTS
)
return
STATUS_INVALID_PARAMETER_1
;
if
(
wait_all
)
flags
|=
SELECT_ALL
;
if
(
alertable
)
flags
|=
SELECT_ALERTABLE
;
select_op
.
wait
.
op
=
SELECT_WAIT
;
select_op
.
wait
.
op
=
wait_all
?
SELECT_WAIT_ALL
:
SELECT_WAIT
;
for
(
i
=
0
;
i
<
count
;
i
++
)
select_op
.
wait
.
handles
[
i
]
=
wine_server_obj_handle
(
handles
[
i
]
);
return
NTDLL_wait_for_multiple_objects
(
&
select_op
,
offsetof
(
select_op_t
,
wait
.
handles
[
count
]
),
flags
,
timeout
,
0
);
}
...
...
include/wine/server_protocol.h
View file @
042e0046
...
...
@@ -407,7 +407,8 @@ struct token_groups
enum
select_op
{
SELECT_NONE
,
SELECT_WAIT
SELECT_WAIT
,
SELECT_WAIT_ALL
};
typedef
union
...
...
@@ -1082,9 +1083,8 @@ struct select_reply
obj_handle_t
apc_handle
;
char
__pad_60
[
4
];
};
#define SELECT_ALL 1
#define SELECT_ALERTABLE 2
#define SELECT_INTERRUPTIBLE 4
#define SELECT_ALERTABLE 1
#define SELECT_INTERRUPTIBLE 2
...
...
@@ -5787,6 +5787,6 @@ union generic_reply
struct
set_suspend_context_reply
set_suspend_context_reply
;
};
#define SERVER_PROTOCOL_VERSION 44
4
#define SERVER_PROTOCOL_VERSION 44
5
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
042e0046
...
...
@@ -423,7 +423,8 @@ struct token_groups
enum select_op
{
SELECT_NONE,
SELECT_WAIT
SELECT_WAIT,
SELECT_WAIT_ALL
};
typedef union
...
...
@@ -431,7 +432,7 @@ typedef union
enum select_op op;
struct
{
enum select_op op; /* SELECT_WAIT */
enum select_op op; /* SELECT_WAIT
or SELECT_WAIT_ALL
*/
obj_handle_t handles[MAXIMUM_WAIT_OBJECTS];
} wait;
} select_op_t;
...
...
@@ -946,9 +947,8 @@ struct rawinput_device
apc_call_t call; /* APC call arguments */
obj_handle_t apc_handle; /* handle to next APC */
@END
#define SELECT_ALL 1
#define SELECT_ALERTABLE 2
#define SELECT_INTERRUPTIBLE 4
#define SELECT_ALERTABLE 1
#define SELECT_INTERRUPTIBLE 2
/* Create an event */
...
...
server/thread.c
View file @
042e0046
...
...
@@ -75,6 +75,7 @@ struct thread_wait
struct
thread
*
thread
;
/* owner thread */
int
count
;
/* count of objects */
int
flags
;
enum
select_op
select
;
client_ptr_t
cookie
;
/* magic cookie to return to client */
timeout_t
timeout
;
struct
timeout_user
*
user
;
...
...
@@ -558,7 +559,8 @@ static void end_wait( struct thread *thread )
}
/* build the thread wait structure */
static
int
wait_on
(
unsigned
int
count
,
struct
object
*
objects
[],
int
flags
,
timeout_t
timeout
)
static
int
wait_on
(
const
select_op_t
*
select_op
,
unsigned
int
count
,
struct
object
*
objects
[],
int
flags
,
timeout_t
timeout
)
{
struct
thread_wait
*
wait
;
struct
wait_queue_entry
*
entry
;
...
...
@@ -569,6 +571,7 @@ static int wait_on( unsigned int count, struct object *objects[], int flags, tim
wait
->
thread
=
current
;
wait
->
count
=
count
;
wait
->
flags
=
flags
;
wait
->
select
=
select_op
->
op
;
wait
->
user
=
NULL
;
wait
->
timeout
=
timeout
;
current
->
wait
=
wait
;
...
...
@@ -602,7 +605,7 @@ static int check_wait( struct thread *thread )
/* Suspended threads may not acquire locks, but they can run system APCs */
if
(
thread
->
process
->
suspend
+
thread
->
suspend
>
0
)
return
-
1
;
if
(
wait
->
flags
&
SELEC
T_ALL
)
if
(
wait
->
select
==
SELECT_WAI
T_ALL
)
{
int
not_ok
=
0
;
/* Note: we must check them all anyway, as some objects may
...
...
@@ -726,6 +729,7 @@ static timeout_t select_on( const select_op_t *select_op, data_size_t op_size, c
break
;
case
SELECT_WAIT
:
case
SELECT_WAIT_ALL
:
count
=
(
op_size
-
offsetof
(
select_op_t
,
wait
.
handles
))
/
sizeof
(
select_op
->
wait
.
handles
[
0
]);
if
(
op_size
<
offsetof
(
select_op_t
,
wait
.
handles
)
||
count
>
MAXIMUM_WAIT_OBJECTS
)
{
...
...
@@ -747,7 +751,7 @@ static timeout_t select_on( const select_op_t *select_op, data_size_t op_size, c
}
if
(
i
<
count
)
goto
done
;
if
(
!
wait_on
(
count
,
objects
,
flags
,
timeout
))
goto
done
;
if
(
!
wait_on
(
select_op
,
count
,
objects
,
flags
,
timeout
))
goto
done
;
/* signal the object */
if
(
signal_obj
)
...
...
server/trace.c
View file @
042e0046
...
...
@@ -399,7 +399,8 @@ static void dump_varargs_select_op( const char *prefix, data_size_t size )
fprintf
(
stderr
,
"NONE"
);
break
;
case
SELECT_WAIT
:
fprintf
(
stderr
,
"WAIT"
);
case
SELECT_WAIT_ALL
:
fprintf
(
stderr
,
"%s"
,
data
.
op
==
SELECT_WAIT
?
"WAIT"
:
"WAIT_ALL"
);
if
(
size
>
offsetof
(
select_op_t
,
wait
.
handles
))
dump_handles
(
",handles="
,
data
.
wait
.
handles
,
min
(
size
,
sizeof
(
data
.
wait
)
)
-
offsetof
(
select_op_t
,
wait
.
handles
));
...
...
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