summaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/handler.c b/handler.c
index d6f19761..acef8f77 100644
--- a/handler.c
+++ b/handler.c
@@ -42,12 +42,12 @@ typedef struct message_s {
typedef struct handler_s {
int queue_size;
- message_t pool[1];
message_t *mfree;
message_t *mqueue;
message_t *mqtail;
uintptr_t mutex;
uintptr_t cond;
+ message_t pool[1];
} handler_t;
static void
@@ -67,8 +67,10 @@ handler_alloc (int queue_size) {
int sz = sizeof (handler_t) + (queue_size-1) * sizeof (message_t);
handler_t *h = malloc (sz);
memset (h, 0, sz);
+ h->queue_size = queue_size;
h->mutex = mutex_create ();
h->cond = cond_create ();
+ handler_reset (h);
return h;
}