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
37773dda
Commit
37773dda
authored
Jul 14, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make mailslots use as much of the default async fd implementation as
possible.
parent
9ad56286
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
57 deletions
+15
-57
fd.c
server/fd.c
+8
-3
file.h
server/file.h
+1
-0
mailslot.c
server/mailslot.c
+6
-54
No files found.
server/fd.c
View file @
37773dda
...
...
@@ -1409,12 +1409,12 @@ void default_poll_event( struct fd *fd, int event )
wake_up
(
fd
->
user
,
0
);
}
void
default_fd_queue_async
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
coun
t
)
void
fd_queue_async_timeout
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
int
*
timeou
t
)
{
struct
list
*
queue
;
int
events
;
if
(
!
(
fd
->
fd_ops
->
get_file_info
(
fd
)
&
FD_FLAG_OVERLAPPED
))
if
(
!
(
fd
->
fd_ops
->
get_file_info
(
fd
)
&
(
FD_FLAG_OVERLAPPED
|
FD_FLAG_TIMEOUT
)
))
{
set_error
(
STATUS_INVALID_HANDLE
);
return
;
...
...
@@ -1433,7 +1433,7 @@ void default_fd_queue_async( struct fd *fd, void *apc, void *user, void *io_sb,
return
;
}
if
(
!
create_async
(
current
,
NULL
,
queue
,
apc
,
user
,
io_sb
))
if
(
!
create_async
(
current
,
timeout
,
queue
,
apc
,
user
,
io_sb
))
return
;
/* Check if the new pending request can be served immediately */
...
...
@@ -1443,6 +1443,11 @@ void default_fd_queue_async( struct fd *fd, void *apc, void *user, void *io_sb,
set_fd_events
(
fd
,
fd
->
fd_ops
->
get_poll_events
(
fd
)
);
}
void
default_fd_queue_async
(
struct
fd
*
fd
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
)
{
fd_queue_async_timeout
(
fd
,
apc
,
user
,
io_sb
,
type
,
count
,
NULL
);
}
void
default_fd_cancel_async
(
struct
fd
*
fd
)
{
async_terminate_queue
(
&
fd
->
read_q
,
STATUS_CANCELLED
);
...
...
server/file.h
View file @
37773dda
...
...
@@ -65,6 +65,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
,
void
*
apc
,
void
*
user
,
void
*
io_sb
,
int
type
,
int
count
,
int
*
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
);
...
...
server/mailslot.c
View file @
37773dda
...
...
@@ -57,7 +57,6 @@ struct mailslot
unsigned
int
max_msgsize
;
unsigned
int
read_timeout
;
struct
list
writers
;
struct
list
read_q
;
};
/* mailslot functions */
...
...
@@ -79,20 +78,17 @@ static const struct object_ops mailslot_ops =
mailslot_destroy
/* destroy */
};
static
int
mailslot_get_poll_events
(
struct
fd
*
);
static
void
mailslot_poll_event
(
struct
fd
*
,
int
);
static
int
mailslot_get_info
(
struct
fd
*
);
static
void
mailslot_queue_async
(
struct
fd
*
,
void
*
,
void
*
,
void
*
,
int
,
int
);
static
void
mailslot_cancel_async
(
struct
fd
*
);
static
const
struct
fd_ops
mailslot_fd_ops
=
{
mailslot_get_poll_events
,
/* get_poll_events */
mailslot_poll_event
,
/* poll_event */
default_fd_get_poll_events
,
/* get_poll_events */
default_poll_event
,
/* poll_event */
no_flush
,
/* flush */
mailslot_get_info
,
/* get_file_info */
mailslot_queue_async
,
/* queue_async */
mailslot_cancel_async
/* cancel_async */
default_fd_cancel_async
/* cancel_async */
};
struct
mail_writer
...
...
@@ -141,8 +137,6 @@ static void mailslot_destroy( struct object *obj)
assert
(
mailslot
->
fd
);
assert
(
mailslot
->
write_fd
);
async_terminate_queue
(
&
mailslot
->
read_q
,
STATUS_CANCELLED
);
release_object
(
mailslot
->
fd
);
release_object
(
mailslot
->
write_fd
);
}
...
...
@@ -191,33 +185,11 @@ static struct fd *mailslot_get_fd( struct object *obj )
return
(
struct
fd
*
)
grab_object
(
mailslot
->
fd
);
}
static
int
mailslot_get_poll_events
(
struct
fd
*
fd
)
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
int
events
=
0
;
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
if
(
!
list_empty
(
&
mailslot
->
read_q
))
events
|=
POLLIN
;
return
events
;
}
static
void
mailslot_poll_event
(
struct
fd
*
fd
,
int
event
)
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
if
(
!
list_empty
(
&
mailslot
->
read_q
)
&&
(
POLLIN
&
event
))
async_terminate_head
(
&
mailslot
->
read_q
,
STATUS_ALERTED
);
set_fd_events
(
fd
,
mailslot_get_poll_events
(
fd
)
);
}
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
events
,
*
p
timeout
=
NULL
;
int
*
timeout
=
NULL
;
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
...
...
@@ -235,28 +207,9 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
}
if
(
mailslot
->
read_timeout
!=
MAILSLOT_WAIT_FOREVER
)
ptimeout
=
&
mailslot
->
read_timeout
;
if
(
!
create_async
(
current
,
ptimeout
,
&
mailslot
->
read_q
,
apc
,
user
,
iosb
))
return
;
/* Check if the new pending request can be served immediately */
events
=
check_fd_events
(
fd
,
mailslot_get_poll_events
(
fd
)
);
if
(
events
)
{
mailslot_poll_event
(
fd
,
events
);
return
;
}
timeout
=
&
mailslot
->
read_timeout
;
set_fd_events
(
fd
,
mailslot_get_poll_events
(
fd
));
}
static
void
mailslot_cancel_async
(
struct
fd
*
fd
)
{
struct
mailslot
*
mailslot
=
get_fd_user
(
fd
);
assert
(
mailslot
->
obj
.
ops
==
&
mailslot_ops
);
async_terminate_queue
(
&
mailslot
->
read_q
,
STATUS_CANCELLED
);
fd_queue_async_timeout
(
fd
,
apc
,
user
,
iosb
,
type
,
count
,
timeout
);
}
static
struct
mailslot
*
create_mailslot
(
const
WCHAR
*
name
,
size_t
len
,
int
max_msgsize
,
...
...
@@ -288,7 +241,6 @@ static struct mailslot *create_mailslot( const WCHAR *name, size_t len, int max_
mailslot
->
max_msgsize
=
max_msgsize
;
mailslot
->
read_timeout
=
read_timeout
;
list_init
(
&
mailslot
->
writers
);
list_init
(
&
mailslot
->
read_q
);
if
(
!
socketpair
(
PF_UNIX
,
SOCK_DGRAM
,
0
,
fds
))
{
...
...
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