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
67da7ba5
Commit
67da7ba5
authored
May 08, 2015
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use the async queue for pipe flush requests.
parent
ad53ffc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
+10
-21
named_pipe.c
server/named_pipe.c
+10
-21
No files found.
server/named_pipe.c
View file @
67da7ba5
...
@@ -76,7 +76,6 @@ struct pipe_server
...
@@ -76,7 +76,6 @@ struct pipe_server
struct
pipe_client
*
client
;
/* client that this server is connected to */
struct
pipe_client
*
client
;
/* client that this server is connected to */
struct
named_pipe
*
pipe
;
struct
named_pipe
*
pipe
;
struct
timeout_user
*
flush_poll
;
struct
timeout_user
*
flush_poll
;
struct
event
*
event
;
unsigned
int
options
;
/* pipe options */
unsigned
int
options
;
/* pipe options */
unsigned
int
pipe_flags
;
unsigned
int
pipe_flags
;
};
};
...
@@ -361,12 +360,9 @@ static void notify_empty( struct pipe_server *server )
...
@@ -361,12 +360,9 @@ static void notify_empty( struct pipe_server *server )
if
(
!
server
->
flush_poll
)
if
(
!
server
->
flush_poll
)
return
;
return
;
assert
(
server
->
state
==
ps_connected_server
);
assert
(
server
->
state
==
ps_connected_server
);
assert
(
server
->
event
);
remove_timeout_user
(
server
->
flush_poll
);
remove_timeout_user
(
server
->
flush_poll
);
server
->
flush_poll
=
NULL
;
server
->
flush_poll
=
NULL
;
set_event
(
server
->
event
);
fd_async_wake_up
(
server
->
fd
,
ASYNC_TYPE_WAIT
,
STATUS_SUCCESS
);
release_object
(
server
->
event
);
server
->
event
=
NULL
;
}
}
static
void
do_disconnect
(
struct
pipe_server
*
server
)
static
void
do_disconnect
(
struct
pipe_server
*
server
)
...
@@ -540,40 +536,33 @@ static void check_flushed( void *arg )
...
@@ -540,40 +536,33 @@ static void check_flushed( void *arg )
{
{
struct
pipe_server
*
server
=
(
struct
pipe_server
*
)
arg
;
struct
pipe_server
*
server
=
(
struct
pipe_server
*
)
arg
;
assert
(
server
->
event
);
if
(
pipe_data_remaining
(
server
))
if
(
pipe_data_remaining
(
server
))
{
{
server
->
flush_poll
=
add_timeout_user
(
-
TICKS_PER_SEC
/
10
,
check_flushed
,
server
);
server
->
flush_poll
=
add_timeout_user
(
-
TICKS_PER_SEC
/
10
,
check_flushed
,
server
);
}
}
else
else
{
{
/* notify_empty( server ); */
server
->
flush_poll
=
NULL
;
server
->
flush_poll
=
NULL
;
set_event
(
server
->
event
);
fd_async_wake_up
(
server
->
fd
,
ASYNC_TYPE_WAIT
,
STATUS_SUCCESS
);
release_object
(
server
->
event
);
server
->
event
=
NULL
;
}
}
}
}
static
obj_handle_t
pipe_server_flush
(
struct
fd
*
fd
,
const
async_data_t
*
async
,
int
blocking
)
static
obj_handle_t
pipe_server_flush
(
struct
fd
*
fd
,
const
async_data_t
*
async
_data
,
int
blocking
)
{
{
struct
pipe_server
*
server
=
get_fd_user
(
fd
);
struct
pipe_server
*
server
=
get_fd_user
(
fd
);
obj_handle_t
handle
=
0
;
obj_handle_t
handle
=
0
;
struct
async
*
async
;
if
(
!
server
||
server
->
state
!=
ps_connected_server
)
return
0
;
if
(
!
server
||
server
->
state
!=
ps_connected_server
)
return
0
;
/* FIXME: if multiple threads flush the same pipe,
if
(
!
pipe_data_remaining
(
server
))
return
0
;
maybe should create a list of processes to notify */
if
(
server
->
flush_poll
)
return
0
;
if
(
pipe_data_remaining
(
server
))
if
(
(
async
=
fd_queue_async
(
server
->
fd
,
async_data
,
ASYNC_TYPE_WAIT
)
))
{
{
/* this kind of sux -
/* there's no unix way to be alerted when a pipe becomes empty, so resort to polling */
there's no unix way to be alerted when a pipe becomes empty */
if
(
!
server
->
flush_poll
)
server
->
event
=
create_event
(
NULL
,
NULL
,
0
,
0
,
0
,
NULL
);
server
->
flush_poll
=
add_timeout_user
(
-
TICKS_PER_SEC
/
10
,
check_flushed
,
server
);
if
(
!
server
->
event
)
return
0
;
if
(
blocking
)
handle
=
alloc_handle
(
current
->
process
,
async
,
SYNCHRONIZE
,
0
);
server
->
flush_poll
=
add_timeout_user
(
-
TICKS_PER_SEC
/
10
,
check_flushed
,
server
);
handle
=
alloc_handle
(
current
->
process
,
server
->
event
,
SYNCHRONIZE
,
0
);
set_error
(
STATUS_PENDING
);
set_error
(
STATUS_PENDING
);
}
}
return
handle
;
return
handle
;
...
...
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