aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/include/waittypes.h
blob: 1215ffe0bebb4bca5ff3be119a1bba6781648b00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef __WAITTYPE_H__
#define __WAITTYPE_H__

#include <mini-os/list.h>

struct thread;
struct wait_queue
{
    struct thread *thread;
    struct minios_list_head thread_list;
};

struct wait_queue_head
{
    /* TODO - lock required? */
    struct minios_list_head thread_list;
};

#define DECLARE_WAIT_QUEUE_HEAD(name) \
   struct wait_queue_head name =     \
        { .thread_list = { &(name).thread_list, &(name).thread_list} }

#define __WAIT_QUEUE_HEAD_INITIALIZER(name) {                           \
    .thread_list      = { &(name).thread_list, &(name).thread_list } }

#endif