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
e92f8547
Commit
e92f8547
authored
Apr 02, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Avoid redundant polling in fd_queue_async_timeout.
Moved the file overlapped flag check to default_fd_queue_async.
parent
95ba4b55
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
fd.c
server/fd.c
+16
-15
file.h
server/file.h
+1
-1
mailslot.c
server/mailslot.c
+1
-1
No files found.
server/fd.c
View file @
e92f8547
...
...
@@ -1719,18 +1719,10 @@ void default_poll_event( struct fd *fd, int event )
wake_up
(
fd
->
user
,
0
);
}
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
,
int
fd_queue_async_timeout
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
,
const
struct
timeval
*
timeout
)
{
struct
list
*
queue
;
int
events
,
flags
;
fd
->
fd_ops
->
get_file_info
(
fd
,
&
flags
);
if
(
!
(
flags
&
(
FD_FLAG_OVERLAPPED
|
FD_FLAG_TIMEOUT
)))
{
set_error
(
STATUS_INVALID_HANDLE
);
return
;
}
switch
(
type
)
{
...
...
@@ -1745,17 +1737,18 @@ void fd_queue_async_timeout( struct fd *fd, const async_data_t *data, int type,
break
;
default:
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
return
0
;
}
if
(
!
create_async
(
current
,
timeout
,
queue
,
data
))
return
;
if
(
!
create_async
(
current
,
timeout
,
queue
,
data
))
return
0
;
set_error
(
STATUS_PENDING
);
/* Check if the new pending request can be served immediately */
events
=
check_fd_events
(
fd
,
fd
->
fd_ops
->
get_poll_events
(
fd
)
);
if
(
events
)
fd
->
fd_ops
->
poll_event
(
fd
,
events
);
if
(
!
fd
->
inode
)
set_fd_events
(
fd
,
fd
->
fd_ops
->
get_poll_events
(
fd
)
);
else
/* regular files are always ready for read and write */
if
(
type
!=
ASYNC_TYPE_WAIT
)
async_terminate_head
(
queue
,
STATUS_ALERTED
);
return
1
;
}
void
fd_async_terminate_head
(
struct
fd
*
fd
,
int
type
,
unsigned
int
status
)
...
...
@@ -1796,6 +1789,14 @@ void fd_async_terminate_queue( struct fd *fd, int type, unsigned int status )
void
default_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
{
int
flags
;
fd
->
fd_ops
->
get_file_info
(
fd
,
&
flags
);
if
(
!
(
flags
&
(
FD_FLAG_OVERLAPPED
|
FD_FLAG_TIMEOUT
)))
{
set_error
(
STATUS_INVALID_HANDLE
);
return
;
}
fd_queue_async_timeout
(
fd
,
data
,
type
,
count
,
NULL
);
}
...
...
server/file.h
View file @
e92f8547
...
...
@@ -68,7 +68,7 @@ extern void default_fd_remove_queue( struct object *obj, struct wait_queue_entry
extern
int
default_fd_signaled
(
struct
object
*
obj
,
struct
thread
*
thread
);
extern
int
default_fd_get_poll_events
(
struct
fd
*
fd
);
extern
void
default_poll_event
(
struct
fd
*
fd
,
int
event
);
extern
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
extern
int
fd_queue_async_timeout
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
,
const
struct
timeval
*
timeout
);
extern
void
fd_async_terminate_head
(
struct
fd
*
fd
,
int
type
,
unsigned
int
status
);
extern
void
fd_async_terminate_queue
(
struct
fd
*
fd
,
int
type
,
unsigned
int
status
);
...
...
server/mailslot.c
View file @
e92f8547
...
...
@@ -302,7 +302,7 @@ static void mailslot_queue_async( struct fd *fd, const async_data_t *data, int t
if
(
mailslot
->
read_timeout
!=
-
1
)
{
struct
timeval
when
=
current_time
;
add_timeout
(
&
when
,
ma
ilslot
->
read_timeout
);
add_timeout
(
&
when
,
ma
x
(
1
,
mailslot
->
read_timeout
)
);
fd_queue_async_timeout
(
fd
,
data
,
type
,
count
,
&
when
);
}
else
fd_queue_async_timeout
(
fd
,
data
,
type
,
count
,
NULL
);
...
...
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