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
ac12c67f
Commit
ac12c67f
authored
May 19, 2010
by
Mike Kaplinskiy
Committed by
Alexandre Julliard
May 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't poll for events when there are async operations queued.
parent
91c7d4f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
sock.c
server/sock.c
+18
-6
No files found.
server/sock.c
View file @
ac12c67f
...
...
@@ -466,7 +466,8 @@ static int sock_signaled( struct object *obj, struct thread *thread )
static
int
sock_get_poll_events
(
struct
fd
*
fd
)
{
struct
sock
*
sock
=
get_fd_user
(
fd
);
unsigned
int
mask
=
sock
->
mask
&
sock
->
state
&
~
sock
->
hmask
;
unsigned
int
mask
=
sock
->
mask
&
~
sock
->
hmask
;
unsigned
int
smask
=
sock
->
state
&
mask
;
int
ev
=
0
;
assert
(
sock
->
obj
.
ops
==
&
sock_ops
);
...
...
@@ -476,15 +477,26 @@ static int sock_get_poll_events( struct fd *fd )
return
POLLOUT
;
if
(
sock
->
state
&
FD_WINE_LISTENING
)
/* listening, wait for readable */
return
(
sock
->
hmask
&
FD_ACCEPT
)
?
0
:
POLLIN
;
return
(
mask
&
FD_ACCEPT
)
?
POLLIN
:
0
;
if
(
mask
&
FD_READ
||
async_waiting
(
sock
->
read_q
))
ev
|=
POLLIN
|
POLLPRI
;
if
(
mask
&
FD_WRITE
||
async_waiting
(
sock
->
write_q
))
ev
|=
POLLOUT
;
if
(
async_queued
(
sock
->
read_q
)
)
{
if
(
async_waiting
(
sock
->
read_q
)
)
ev
|=
POLLIN
|
POLLPRI
;
}
else
if
(
smask
&
FD_READ
)
ev
|=
POLLIN
|
POLLPRI
;
/* We use POLLIN with 0 bytes recv() as FD_CLOSE indication for stream sockets. */
if
(
sock
->
type
==
SOCK_STREAM
&&
(
sock
->
mask
&
~
sock
->
hmask
&
FD_CLOSE
)
&&
!
(
sock
->
hmask
&
FD_READ
)
&&
sock
->
state
&
FD_READ
)
else
if
(
sock
->
type
==
SOCK_STREAM
&&
sock
->
state
&
FD_READ
&&
mask
&
FD_CLOSE
&&
!
(
sock
->
hmask
&
FD_READ
)
)
ev
|=
POLLIN
;
if
(
async_queued
(
sock
->
write_q
)
)
{
if
(
async_waiting
(
sock
->
write_q
)
)
ev
|=
POLLOUT
;
}
else
if
(
smask
&
FD_WRITE
)
ev
|=
POLLOUT
;
return
ev
;
}
...
...
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