mirror of https://github.com/bjornbytes/lovr.git
Clean up thread module;
This commit is contained in:
parent
a4e563fe6f
commit
1aef9963f5
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue