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
40723f79
Commit
40723f79
authored
Jul 26, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Make the create_async function take an absolute timeout.
parent
a624977f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
27 deletions
+28
-27
fd.c
server/fd.c
+5
-11
file.h
server/file.h
+3
-2
mailslot.c
server/mailslot.c
+8
-4
named_pipe.c
server/named_pipe.c
+8
-8
serial.c
server/serial.c
+4
-2
No files found.
server/fd.c
View file @
40723f79
...
...
@@ -1116,8 +1116,8 @@ static void async_callback(void *private)
}
/* create an async on a given queue of a fd */
struct
async
*
create_async
(
struct
thread
*
thread
,
int
*
timeout
,
struct
list
*
queue
,
void
*
io_apc
,
void
*
io_user
,
void
*
io_sb
)
struct
async
*
create_async
(
struct
thread
*
thread
,
const
struct
timeval
*
timeout
,
struct
list
*
queue
,
void
*
io_apc
,
void
*
io_user
,
void
*
io_sb
)
{
struct
async
*
async
=
mem_alloc
(
sizeof
(
struct
async
)
);
...
...
@@ -1130,14 +1130,7 @@ struct async *create_async(struct thread *thread, int* timeout, struct list *que
list_add_tail
(
queue
,
&
async
->
entry
);
if
(
timeout
)
{
struct
timeval
when
;
gettimeofday
(
&
when
,
NULL
);
add_timeout
(
&
when
,
*
timeout
);
async
->
timeout
=
add_timeout_user
(
&
when
,
async_callback
,
async
);
}
if
(
timeout
)
async
->
timeout
=
add_timeout_user
(
timeout
,
async_callback
,
async
);
else
async
->
timeout
=
NULL
;
return
async
;
...
...
@@ -1583,7 +1576,8 @@ void default_poll_event( struct fd *fd, int event )
wake_up
(
fd
->
user
,
0
);
}
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
int
*
timeout
)
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
const
struct
timeval
*
timeout
)
{
struct
list
*
queue
;
int
events
;
...
...
server/file.h
View file @
40723f79
...
...
@@ -66,7 +66,8 @@ 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
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
int
*
timeout
);
extern
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
const
struct
timeval
*
timeout
);
extern
void
default_fd_queue_async
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
);
extern
void
default_fd_cancel_async
(
struct
fd
*
fd
);
extern
int
no_flush
(
struct
fd
*
fd
,
struct
event
**
event
);
...
...
@@ -117,7 +118,7 @@ extern int is_serial_fd( struct fd *fd );
extern
struct
object
*
create_serial
(
struct
fd
*
fd
,
unsigned
int
options
);
/* async I/O functions */
extern
struct
async
*
create_async
(
struct
thread
*
thread
,
int
*
timeout
,
extern
struct
async
*
create_async
(
struct
thread
*
thread
,
const
struct
timeval
*
timeout
,
struct
list
*
queue
,
void
*
,
void
*
,
void
*
);
extern
void
async_terminate_head
(
struct
list
*
queue
,
int
status
);
...
...
server/mailslot.c
View file @
40723f79
...
...
@@ -249,7 +249,6 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
void
*
iosb
,
int
type
,
int
count
)
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
int
*
timeout
=
NULL
;
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
...
...
@@ -266,9 +265,14 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
return
;
}
if
(
mailslot
->
read_timeout
!=
-
1
)
timeout
=
&
mailslot
->
read_timeout
;
fd_queue_async_timeout
(
fd
,
apc
,
user
,
iosb
,
type
,
count
,
timeout
);
if
(
mailslot
->
read_timeout
!=
-
1
)
{
struct
timeval
when
;
gettimeofday
(
&
when
,
NULL
);
add_timeout
(
&
when
,
mailslot
->
read_timeout
);
fd_queue_async_timeout
(
fd
,
apc
,
user
,
iosb
,
type
,
count
,
&
when
);
}
else
fd_queue_async_timeout
(
fd
,
apc
,
user
,
iosb
,
type
,
count
,
NULL
);
}
static
void
mailslot_device_dump
(
struct
object
*
obj
,
int
verbose
)
...
...
server/named_pipe.c
View file @
40723f79
...
...
@@ -868,18 +868,18 @@ DECL_HANDLER(wait_named_pipe)
}
else
{
int
timeout
;
if
(
req
->
timeout
==
NMPWAIT_USE_DEFAULT_WAIT
)
timeout
=
pipe
->
timeout
;
else
timeout
=
req
->
timeout
;
if
(
req
->
timeout
==
NMPWAIT_WAIT_FOREVER
)
create_async
(
current
,
NULL
,
&
pipe
->
waiters
,
req
->
func
,
req
->
event
,
NULL
);
else
create_async
(
current
,
&
timeout
,
&
pipe
->
waiters
,
req
->
func
,
req
->
event
,
NULL
);
{
struct
timeval
when
;
gettimeofday
(
&
when
,
NULL
);
if
(
req
->
timeout
==
NMPWAIT_USE_DEFAULT_WAIT
)
add_timeout
(
&
when
,
pipe
->
timeout
);
else
add_timeout
(
&
when
,
req
->
timeout
);
create_async
(
current
,
&
when
,
&
pipe
->
waiters
,
req
->
func
,
req
->
event
,
NULL
);
}
}
release_object
(
pipe
);
...
...
server/serial.c
View file @
40723f79
...
...
@@ -246,6 +246,7 @@ static void serial_queue_async( struct fd *fd, void *apc, void *user, void *iosb
{
struct
serial
*
serial
=
get_fd_user
(
fd
);
struct
list
*
queue
;
struct
timeval
when
;
int
timeout
;
int
events
;
...
...
@@ -270,8 +271,9 @@ static void serial_queue_async( struct fd *fd, void *apc, void *user, void *iosb
return
;
}
if
(
!
create_async
(
current
,
&
timeout
,
queue
,
apc
,
user
,
iosb
))
return
;
gettimeofday
(
&
when
,
NULL
);
add_timeout
(
&
when
,
timeout
);
if
(
!
create_async
(
current
,
&
when
,
queue
,
apc
,
user
,
iosb
))
return
;
/* Check if the new pending request can be served immediately */
events
=
check_fd_events
(
fd
,
serial_get_poll_events
(
fd
)
);
...
...
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