Clean up thread module;

This commit is contained in:
bjorn 2019-05-14 04:43:38 -07:00
parent a4e563fe6f
commit 1aef9963f5
3 changed files with 5 additions and 9 deletions

View File

@ -1,7 +1,6 @@
#include "thread/channel.h"
#include "util.h"
#include <math.h>
#include <stdlib.h>
Channel* lovrChannelInit(Channel* channel) {
vec_init(&channel->messages);

View File

@ -1,9 +1,12 @@
#include "thread/thread.h"
#include "thread/channel.h"
#include "util.h"
#include <stdlib.h>
#include "lib/map/map.h"
static ThreadState state;
static struct {
bool initialized;
map_void_t channels;
} state;
bool lovrThreadModuleInit() {
if (state.initialized) return false;

View File

@ -1,18 +1,12 @@
#include "types.h"
#include "data/blob.h"
#include "lib/tinycthread/tinycthread.h"
#include "lib/map/map.h"
#include <stdbool.h>
#pragma once
struct Channel;
typedef struct {
bool initialized;
map_void_t channels;
} ThreadState;
typedef struct Thread {
Ref ref;
thrd_t handle;