Fixed a bug that caused APCs to be "forgotten".
[wine] / server / async.h
1
2 #ifndef _SERVER_ASYNC_
3 #define _SERVER_ASYNC_
4
5 #include <sys/time.h>
6 #include "object.h"
7
8 struct async_queue;
9
10 struct async 
11 {
12     struct object       *obj;
13     struct thread       *thread;
14     void                *func;
15     void                *overlapped;
16     unsigned int         status;
17     struct timeval       when;
18     struct timeout_user *timeout;
19     struct async        *next,*prev;
20     struct async_queue  *q;
21 };
22
23 struct async_queue
24 {
25     struct async        *head;
26     struct async        *tail;
27 };
28
29 void destroy_async( struct async *async );
30 void destroy_async_queue( struct async_queue *q );
31 void async_notify(struct async *async, int status);
32 struct async *find_async(struct async_queue *q, struct thread *thread, void *overlapped);
33 void async_insert(struct async_queue *q, struct async *async);
34 struct async *create_async(struct object *obj, struct thread *thread, 
35                            void *func, void *overlapped);
36 void async_add_timeout(struct async *async, int timeout);
37 static inline void init_async_queue(struct async_queue *q) 
38
39     q->head = q->tail = NULL;
40 }
41
42 #define IS_READY(q) (((q).head) && ((q).head->status==STATUS_PENDING))
43
44 #endif /* _SERVER_ASYNC_ */
45