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
42debac1
Commit
42debac1
authored
May 15, 2010
by
Mike Kaplinskiy
Committed by
Alexandre Julliard
May 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Move socket async activation to sock_poll_event.
parent
4aee4c7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
22 deletions
+29
-22
sock.c
dlls/ws2_32/tests/sock.c
+4
-4
async.c
server/async.c
+6
-0
file.h
server/file.h
+1
-0
sock.c
server/sock.c
+18
-18
No files found.
dlls/ws2_32/tests/sock.c
View file @
42debac1
...
@@ -3133,10 +3133,10 @@ static void test_events(int useMessages)
...
@@ -3133,10 +3133,10 @@ static void test_events(int useMessages)
ok
(
ret
==
2
,
"Failed to send buffer %d err %d
\n
"
,
ret
,
GetLastError
());
ok
(
ret
==
2
,
"Failed to send buffer %d err %d
\n
"
,
ret
,
GetLastError
());
broken_seq
[
0
]
=
read_read_seq
;
/* win9x */
broken_seq
[
0
]
=
read_read_seq
;
/* win9x */
broken_seq
[
1
]
=
NULL
;
broken_seq
[
1
]
=
NULL
;
if
(
useMessages
)
/* we like to erase pmask in server, so we have varying behavior here */
/* we like to erase pmask in server, so we have varying behavior here *
todo_wine
ok_event_seq
(
src
,
hEvent
,
empty_seq
,
broken_seq
,
0
);
* it is only fixed for now because we refuse to send notifications with
else
* any kind of asyncs requests running */
ok_event_seq
(
src
,
hEvent
,
empty_seq
,
broken_seq
,
0
);
ok_event_seq
(
src
,
hEvent
,
empty_seq
,
broken_seq
,
0
);
dwRet
=
WaitForSingleObject
(
ov
.
hEvent
,
100
);
dwRet
=
WaitForSingleObject
(
ov
.
hEvent
,
100
);
ok
(
dwRet
==
WAIT_OBJECT_0
,
"Failed to wait for recv message: %d - %d
\n
"
,
dwRet
,
GetLastError
());
ok
(
dwRet
==
WAIT_OBJECT_0
,
"Failed to wait for recv message: %d - %d
\n
"
,
dwRet
,
GetLastError
());
...
...
server/async.c
View file @
42debac1
...
@@ -276,6 +276,12 @@ void async_set_result( struct object *obj, unsigned int status, unsigned int tot
...
@@ -276,6 +276,12 @@ void async_set_result( struct object *obj, unsigned int status, unsigned int tot
}
}
}
}
/* check if there are any queued async operations */
int
async_queued
(
struct
async_queue
*
queue
)
{
return
queue
&&
list_head
(
&
queue
->
queue
);
}
/* check if an async operation is waiting to be alerted */
/* check if an async operation is waiting to be alerted */
int
async_waiting
(
struct
async_queue
*
queue
)
int
async_waiting
(
struct
async_queue
*
queue
)
{
{
...
...
server/file.h
View file @
42debac1
...
@@ -146,6 +146,7 @@ extern struct async *create_async( struct thread *thread, struct async_queue *qu
...
@@ -146,6 +146,7 @@ extern struct async *create_async( struct thread *thread, struct async_queue *qu
extern
void
async_set_timeout
(
struct
async
*
async
,
timeout_t
timeout
,
unsigned
int
status
);
extern
void
async_set_timeout
(
struct
async
*
async
,
timeout_t
timeout
,
unsigned
int
status
);
extern
void
async_set_result
(
struct
object
*
obj
,
unsigned
int
status
,
extern
void
async_set_result
(
struct
object
*
obj
,
unsigned
int
status
,
unsigned
int
total
,
client_ptr_t
apc
);
unsigned
int
total
,
client_ptr_t
apc
);
extern
int
async_queued
(
struct
async_queue
*
queue
);
extern
int
async_waiting
(
struct
async_queue
*
queue
);
extern
int
async_waiting
(
struct
async_queue
*
queue
);
extern
void
async_terminate
(
struct
async
*
async
,
unsigned
int
status
);
extern
void
async_terminate
(
struct
async
*
async
,
unsigned
int
status
);
extern
int
async_wake_up_by
(
struct
async_queue
*
queue
,
struct
process
*
process
,
extern
int
async_wake_up_by
(
struct
async_queue
*
queue
,
struct
process
*
process
,
...
...
server/sock.c
View file @
42debac1
...
@@ -255,28 +255,14 @@ static int sock_reselect( struct sock *sock )
...
@@ -255,28 +255,14 @@ static int sock_reselect( struct sock *sock )
}
}
/* wake anybody waiting on the socket event or send the associated message */
/* wake anybody waiting on the socket event or send the associated message */
static
void
sock_wake_up
(
struct
sock
*
sock
,
int
pollev
)
static
void
sock_wake_up
(
struct
sock
*
sock
)
{
{
unsigned
int
events
=
sock
->
pmask
&
sock
->
mask
;
unsigned
int
events
=
sock
->
pmask
&
sock
->
mask
;
int
i
;
int
i
;
int
async_active
=
0
;
if
(
pollev
&
(
POLLIN
|
POLLPRI
|
POLLERR
|
POLLHUP
)
&&
async_waiting
(
sock
->
read_q
))
{
if
(
debug_level
)
fprintf
(
stderr
,
"activating read queue for socket %p
\n
"
,
sock
);
async_wake_up
(
sock
->
read_q
,
STATUS_ALERTED
);
async_active
=
1
;
}
if
(
pollev
&
(
POLLOUT
|
POLLERR
|
POLLHUP
)
&&
async_waiting
(
sock
->
write_q
))
{
if
(
debug_level
)
fprintf
(
stderr
,
"activating write queue for socket %p
\n
"
,
sock
);
async_wake_up
(
sock
->
write_q
,
STATUS_ALERTED
);
async_active
=
1
;
}
/* Do not signal events if there are still pending asynchronous IO requests */
/* Do not signal events if there are still pending asynchronous IO requests */
/* We need this to delay FD_CLOSE events until all pending overlapped requests are processed */
/* We need this to delay FD_CLOSE events until all pending overlapped requests are processed */
if
(
!
events
||
async_
active
)
return
;
if
(
!
events
||
async_
queued
(
sock
->
read_q
)
||
async_queued
(
sock
->
write_q
)
)
return
;
if
(
sock
->
event
)
if
(
sock
->
event
)
{
{
...
@@ -437,7 +423,21 @@ static void sock_poll_event( struct fd *fd, int event )
...
@@ -437,7 +423,21 @@ static void sock_poll_event( struct fd *fd, int event )
}
}
/* wake up anyone waiting for whatever just happened */
/* wake up anyone waiting for whatever just happened */
if
(
sock
->
pmask
&
sock
->
mask
||
sock
->
flags
&
WSA_FLAG_OVERLAPPED
)
sock_wake_up
(
sock
,
event
);
sock_wake_up
(
sock
);
if
(
sock
->
flags
&
WSA_FLAG_OVERLAPPED
)
{
if
(
event
&
(
POLLIN
|
POLLPRI
|
POLLERR
|
POLLHUP
)
&&
async_waiting
(
sock
->
read_q
))
{
if
(
debug_level
)
fprintf
(
stderr
,
"activating read queue for socket %p
\n
"
,
sock
);
async_wake_up
(
sock
->
read_q
,
STATUS_ALERTED
);
}
if
(
event
&
(
POLLOUT
|
POLLERR
|
POLLHUP
)
&&
async_waiting
(
sock
->
write_q
))
{
if
(
debug_level
)
fprintf
(
stderr
,
"activating write queue for socket %p
\n
"
,
sock
);
async_wake_up
(
sock
->
write_q
,
STATUS_ALERTED
);
}
}
/* if anyone is stupid enough to wait on the socket object itself,
/* if anyone is stupid enough to wait on the socket object itself,
* maybe we should wake them up too, just in case? */
* maybe we should wake them up too, just in case? */
...
@@ -876,7 +876,7 @@ DECL_HANDLER(set_socket_event)
...
@@ -876,7 +876,7 @@ DECL_HANDLER(set_socket_event)
it is possible that FD_CONNECT or FD_ACCEPT network events has happened
it is possible that FD_CONNECT or FD_ACCEPT network events has happened
before a WSAEventSelect() was done on it.
before a WSAEventSelect() was done on it.
(when dealing with Asynchronous socket) */
(when dealing with Asynchronous socket) */
if
(
sock
->
pmask
&
sock
->
mask
)
sock_wake_up
(
sock
,
pollev
);
sock_wake_up
(
sock
);
if
(
old_event
)
release_object
(
old_event
);
/* we're through with it */
if
(
old_event
)
release_object
(
old_event
);
/* we're through with it */
release_object
(
&
sock
->
obj
);
release_object
(
&
sock
->
obj
);
...
...
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