Kernel - Expose thread timer for EVENT_TIMER, multiple sleepers for workqueue, cleanu...
[tpg/acess2.git] / KernelLand / Kernel / include / workqueue.h
1 /**
2  * Acess2 Kernel
3  * - By John Hodge (thePowersGang)
4  *
5  * workqueue.h
6  * - FIFO Queue
7  */
8 #ifndef _WORKQUEUE_H_
9 #define _WORKQUEUE_H_
10
11 #include <acess.h>
12
13 typedef struct sWorkqueue       tWorkqueue;
14
15 struct sWorkqueue
16 {
17         tShortSpinlock  Protector;
18         const char      *Name;
19          int    NextOffset;
20         
21         void    *Head;
22         void    *Tail;
23         struct sThread  *Sleeper;
24         struct sThread  *SleepTail;
25 };
26
27 extern void     Workqueue_Init(tWorkqueue *Queue, const char *Name, size_t NextOfset);
28 extern void     *Workqueue_GetWork(tWorkqueue *Queue);
29 extern void     Workqueue_AddWork(tWorkqueue *Queue, void *Ptr);
30
31 #endif
32

UCC git Repository :: git.ucc.asn.au