5 #include <pthread.h> /* for mutexes */
6 #include <stdint.h> /* for uint32_t */
7 #include "req.h" /* for req_info */
15 struct queue_entry
*top
, *bottom
;
24 unsigned char *newval
;
29 struct queue_entry
*prev
;
30 /* A pointer to the next element on the list is actually not
31 * necessary, because it's not needed for put and get.
36 struct queue
*queue_create();
37 void queue_free(struct queue
*q
);
39 struct queue_entry
*queue_entry_create();
40 void queue_entry_free(struct queue_entry
*e
);
42 void queue_lock(struct queue
*q
)
44 void queue_unlock(struct queue
*q
)
46 void queue_signal(struct queue
*q
);
47 int queue_timedwait(struct queue
*q
, struct timespec
*ts
)
48 __with_lock_acquired(q
->lock
);
50 void queue_put(struct queue
*q
, struct queue_entry
*e
)
51 __with_lock_acquired(q
->lock
);
52 struct queue_entry
*queue_get(struct queue
*q
)
53 __with_lock_acquired(q
->lock
);
54 int queue_isempty(struct queue
*q
)
55 __with_lock_acquired(q
->lock
);