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
95ba4b55
Commit
95ba4b55
authored
Apr 02, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add a generic wait queue to the file descriptor object.
parent
274115f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
fd.c
server/fd.c
+44
-0
file.h
server/file.h
+2
-0
No files found.
server/fd.c
View file @
95ba4b55
...
...
@@ -173,6 +173,7 @@ struct fd
int
poll_index
;
/* index of fd in poll array */
struct
list
read_q
;
/* async readers of this fd */
struct
list
write_q
;
/* async writers of this fd */
struct
list
wait_q
;
/* other async waiters of this fd */
};
static
void
fd_dump
(
struct
object
*
obj
,
int
verbose
);
...
...
@@ -1287,6 +1288,7 @@ static void fd_destroy( struct object *obj )
async_terminate_queue
(
&
fd
->
read_q
,
STATUS_CANCELLED
);
async_terminate_queue
(
&
fd
->
write_q
,
STATUS_CANCELLED
);
async_terminate_queue
(
&
fd
->
wait_q
,
STATUS_CANCELLED
);
remove_fd_locks
(
fd
);
list_remove
(
&
fd
->
inode_entry
);
...
...
@@ -1365,6 +1367,7 @@ static struct fd *alloc_fd_object(void)
list_init
(
&
fd
->
locks
);
list_init
(
&
fd
->
read_q
);
list_init
(
&
fd
->
write_q
);
list_init
(
&
fd
->
wait_q
);
if
((
fd
->
poll_index
=
add_poll_user
(
fd
))
==
-
1
)
{
...
...
@@ -1395,6 +1398,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
list_init
(
&
fd
->
locks
);
list_init
(
&
fd
->
read_q
);
list_init
(
&
fd
->
write_q
);
list_init
(
&
fd
->
wait_q
);
return
fd
;
}
...
...
@@ -1736,6 +1740,9 @@ void fd_queue_async_timeout( struct fd *fd, const async_data_t *data, int type,
case
ASYNC_TYPE_WRITE
:
queue
=
&
fd
->
write_q
;
break
;
case
ASYNC_TYPE_WAIT
:
queue
=
&
fd
->
wait_q
;
break
;
default:
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
...
...
@@ -1751,6 +1758,42 @@ void fd_queue_async_timeout( struct fd *fd, const async_data_t *data, int type,
set_fd_events
(
fd
,
fd
->
fd_ops
->
get_poll_events
(
fd
)
);
}
void
fd_async_terminate_head
(
struct
fd
*
fd
,
int
type
,
unsigned
int
status
)
{
switch
(
type
)
{
case
ASYNC_TYPE_READ
:
async_terminate_head
(
&
fd
->
read_q
,
status
);
break
;
case
ASYNC_TYPE_WRITE
:
async_terminate_head
(
&
fd
->
write_q
,
status
);
break
;
case
ASYNC_TYPE_WAIT
:
async_terminate_head
(
&
fd
->
wait_q
,
status
);
break
;
default:
assert
(
0
);
}
}
void
fd_async_terminate_queue
(
struct
fd
*
fd
,
int
type
,
unsigned
int
status
)
{
switch
(
type
)
{
case
ASYNC_TYPE_READ
:
async_terminate_queue
(
&
fd
->
read_q
,
status
);
break
;
case
ASYNC_TYPE_WRITE
:
async_terminate_queue
(
&
fd
->
write_q
,
status
);
break
;
case
ASYNC_TYPE_WAIT
:
async_terminate_queue
(
&
fd
->
wait_q
,
status
);
break
;
default:
assert
(
0
);
}
}
void
default_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
)
{
fd_queue_async_timeout
(
fd
,
data
,
type
,
count
,
NULL
);
...
...
@@ -1760,6 +1803,7 @@ void default_fd_cancel_async( struct fd *fd )
{
async_terminate_queue
(
&
fd
->
read_q
,
STATUS_CANCELLED
);
async_terminate_queue
(
&
fd
->
write_q
,
STATUS_CANCELLED
);
async_terminate_queue
(
&
fd
->
wait_q
,
STATUS_CANCELLED
);
}
/* default flush() routine */
...
...
server/file.h
View file @
95ba4b55
...
...
@@ -70,6 +70,8 @@ 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
,
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
);
extern
void
default_fd_queue_async
(
struct
fd
*
fd
,
const
async_data_t
*
data
,
int
type
,
int
count
);
extern
void
default_fd_cancel_async
(
struct
fd
*
fd
);
extern
void
no_flush
(
struct
fd
*
fd
,
struct
event
**
event
);
...
...
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