#include <signal.h>
#include <string.h>
#include <stdlib.h>
+#include <pthread.h>
#include "mgt.h"
#include "mgt_event.h"
unsigned char compact_pfd;
unsigned char disturbed;
unsigned psig;
+ pthread_t thread;
};
/*--------------------------------------------------------------------*/
evb->magic = EVBASE_MAGIC;
VTAILQ_INIT(&evb->events);
evb->binheap = binheap_new(evb, ev_bh_cmp, ev_bh_update);
+ evb->thread = pthread_self();
return (evb);
}
ev_destroy_base(struct evbase *evb)
{
CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC);
+ assert(evb->thread == pthread_self());
evb->magic = 0;
free(evb);
}
assert(e->sig >= 0);
assert(e->timeout >= 0.0);
assert(e->fd < 0 || e->fd_flags);
+ assert(evb->thread == pthread_self());
if (e->sig > 0 && ev_get_sig(e->sig))
return (ENOMEM);
CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC);
CHECK_OBJ_NOTNULL(e, EV_MAGIC);
assert(evb == e->__evb);
+ assert(evb->thread == pthread_self());
if (e->__binheap_idx != 0)
binheap_delete(evb->binheap, e->__binheap_idx);
int i;
CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC);
+ assert(evb->thread == pthread_self());
do
i = ev_schedule_one(evb);
while (i == 1);
struct pollfd *pfd;
CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC);
+ assert(evb->thread == pthread_self());
e = binheap_root(evb->binheap);
if (e != NULL) {
CHECK_OBJ_NOTNULL(e, EV_MAGIC);