Rename thread module init/destroy;

This commit is contained in:
bjorn 2018-12-19 00:04:55 -08:00 committed by Bjorn Swenson
parent c63c49338a
commit 60a12a6b7e
3 changed files with 6 additions and 6 deletions

View File

@ -69,8 +69,8 @@ int luaopen_lovr_thread(lua_State* L) {
luaL_register(L, NULL, lovrThreadModule);
luax_registertype(L, "Thread", lovrThread);
luax_registertype(L, "Channel", lovrChannel);
if (lovrThreadInit()) {
luax_atexit(L, lovrThreadDeinit);
if (lovrThreadModuleInit()) {
luax_atexit(L, lovrThreadModuleDestroy);
}
return 1;
}

View File

@ -4,13 +4,13 @@
static ThreadState state;
bool lovrThreadInit() {
bool lovrThreadModuleInit() {
if (state.initialized) return false;
map_init(&state.channels);
return state.initialized = true;
}
void lovrThreadDeinit() {
void lovrThreadModuleDestroy() {
if (!state.initialized) return;
const char* key;
map_iter_t iter = map_iter(&state.channels);

View File

@ -22,8 +22,8 @@ typedef struct {
bool running;
} Thread;
bool lovrThreadInit();
void lovrThreadDeinit();
bool lovrThreadModuleInit();
void lovrThreadModuleDestroy();
struct Channel* lovrThreadGetChannel(const char* name);
Thread* lovrThreadCreate(int (*runner)(void*), const char* body);