Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / io-layer / wait-private.h
1 #ifndef _WAPI_WAIT_PRIVATE_H_
2 #define _WAPI_WAIT_PRIVATE_H_
3
4 /* This is an internal, private header file */
5
6 #include <config.h>
7
8 #include <glib.h>
9 #include <pthread.h>
10 #include <semaphore.h>
11
12 #include "wapi-private.h"
13 #include "timed-thread.h"
14
15 #include "mono-mutex.h"
16
17 typedef enum {
18         WQ_NEW,
19         WQ_WAITING,
20         WQ_SIGNALLED,
21 } WaitQueueState;
22
23 typedef struct _WaitQueueItem 
24 {
25         mono_mutex_t mutex;
26         sem_t wait_sem;
27         WaitQueueState state;
28         guint32 update, ack;
29         guint32 timeout;
30         gboolean waitall;
31         GPtrArray *handles[WAPI_HANDLE_COUNT];
32         TimedThread *thread[WAPI_HANDLE_COUNT];
33         gboolean waited[WAPI_HANDLE_COUNT];
34         guint32 waitcount[WAPI_HANDLE_COUNT];
35         /* waitindex must be kept synchronised with the handles array,
36          * such that index n of one matches index n of the other
37          */
38         GArray *waitindex[WAPI_HANDLE_COUNT];
39         guint32 lowest_signal;
40 } WaitQueueItem;
41
42 #endif /* _WAPI_WAIT_PRIVATE_H_ */