void scheduler_deletetask(lua_State *L) { hive_getenv(L, "message_queue"); struct global_queue *mq = lua_touserdata(L, -1); globalmq_dec(mq); lua_close(L); }
static int _message_dispatch(struct global_queue *q) { struct cell *c = globalmq_pop(q); if (c == NULL) return 1; int r = cell_dispatch_message(c); switch(r) { case CELL_EMPTY: case CELL_MESSAGE: break; case CELL_QUIT: globalmq_dec(q); return 1; } globalmq_push(q, c); return r; }