Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
879d46e4
Commit
879d46e4
authored
Jun 26, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Return async result directly instead of via APCs if it's available.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0e0834ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
file.c
dlls/ntdll/file.c
+5
-0
async.c
server/async.c
+30
-2
No files found.
dlls/ntdll/file.c
View file @
879d46e4
...
...
@@ -580,6 +580,11 @@ static NTSTATUS server_read_file( HANDLE handle, HANDLE event, PIO_APC_ROUTINE a
status
=
wine_server_call
(
req
);
wait_handle
=
wine_server_ptr_handle
(
reply
->
wait
);
options
=
reply
->
options
;
if
(
wait_handle
&&
status
!=
STATUS_PENDING
)
{
io
->
u
.
Status
=
status
;
io
->
Information
=
wine_server_reply_size
(
reply
);
}
}
SERVER_END_REQ
;
...
...
server/async.c
View file @
879d46e4
...
...
@@ -49,6 +49,7 @@ struct async
async_data_t
data
;
/* data for async I/O call */
struct
iosb
*
iosb
;
/* I/O status block */
obj_handle_t
wait_handle
;
/* pre-allocated wait handle */
int
direct_result
;
/* a flag if we're passing result directly from request instead of APC */
};
static
void
async_dump
(
struct
object
*
obj
,
int
verbose
);
...
...
@@ -138,6 +139,12 @@ static void async_satisfied( struct object *obj, struct wait_queue_entry *entry
struct
async
*
async
=
(
struct
async
*
)
obj
;
assert
(
obj
->
ops
==
&
async_ops
);
if
(
async
->
direct_result
)
{
async_set_result
(
&
async
->
obj
,
async
->
iosb
->
status
,
async
->
iosb
->
result
);
async
->
direct_result
=
0
;
}
/* close wait handle here to avoid extra server round trip */
if
(
async
->
wait_handle
)
{
...
...
@@ -195,6 +202,8 @@ void async_terminate( struct async *async, unsigned int status )
async
->
status
=
status
;
if
(
async
->
iosb
&&
async
->
iosb
->
status
==
STATUS_PENDING
)
async
->
iosb
->
status
=
status
;
if
(
!
async
->
direct_result
)
{
if
(
async
->
data
.
user
)
{
apc_call_t
data
;
...
...
@@ -207,6 +216,7 @@ void async_terminate( struct async *async, unsigned int status )
thread_queue_apc
(
async
->
thread
,
&
async
->
obj
,
&
data
);
}
else
async_set_result
(
&
async
->
obj
,
STATUS_SUCCESS
,
0
);
}
async_reselect
(
async
);
if
(
async
->
queue
)
release_object
(
async
);
/* so that it gets destroyed when the async is done */
...
...
@@ -278,6 +288,7 @@ struct async *create_async( struct thread *thread, const async_data_t *data, str
async
->
queue
=
NULL
;
async
->
signaled
=
0
;
async
->
wait_handle
=
0
;
async
->
direct_result
=
0
;
if
(
iosb
)
async
->
iosb
=
(
struct
iosb
*
)
grab_object
(
iosb
);
else
async
->
iosb
=
NULL
;
...
...
@@ -307,6 +318,7 @@ struct async *create_request_async( struct thread *thread, const async_data_t *d
release_object
(
async
);
return
NULL
;
}
async
->
direct_result
=
1
;
}
return
async
;
}
...
...
@@ -321,12 +333,25 @@ obj_handle_t async_handoff( struct async *async, int success )
return
0
;
}
if
(
async
->
iosb
->
status
==
STATUS_PENDING
&&
!
async_is_blocking
(
async
))
if
(
async
->
iosb
->
status
!=
STATUS_PENDING
)
{
if
(
async
->
iosb
->
out_data
)
{
set_reply_data_ptr
(
async
->
iosb
->
out_data
,
async
->
iosb
->
out_size
);
async
->
iosb
->
out_data
=
NULL
;
}
async
->
signaled
=
1
;
}
else
{
async
->
direct_result
=
0
;
if
(
!
async_is_blocking
(
async
))
{
close_handle
(
async
->
thread
->
process
,
async
->
wait_handle
);
async
->
wait_handle
=
0
;
}
set_error
(
STATUS_PENDING
);
}
set_error
(
async
->
iosb
->
status
);
return
async
->
wait_handle
;
}
...
...
@@ -399,9 +424,12 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
}
if
(
async
->
event
)
set_event
(
async
->
event
);
else
if
(
async
->
queue
&&
async
->
queue
->
fd
)
set_fd_signaled
(
async
->
queue
->
fd
,
1
);
if
(
!
async
->
signaled
)
{
async
->
signaled
=
1
;
wake_up
(
&
async
->
obj
,
0
);
}
}
}
/* check if there are any queued async operations */
...
...
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