From bd3a6a04601749cbde007eaabf803fb602ee2783 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Thu, 19 Jun 2025 03:13:48 -0300 Subject: beginning of `communication.cc` --- src/thread.hh | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 src/thread.hh (limited to 'src/thread.hh') diff --git a/src/thread.hh b/src/thread.hh deleted file mode 100644 index 17e46e9..0000000 --- a/src/thread.hh +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef TIBIA_THREAD_HH_ -#define TIBIA_THREAD_HH_ 1 - -#include "common.hh" -#include - -typedef pthread_t ThreadHandle; -typedef int (ThreadFunction)(void *); - -// TODO(fusion): Probably have another way to tell whether the thread was -// successfully spawned or not? -constexpr ThreadHandle INVALID_THREAD_HANDLE = 0; - -ThreadHandle StartThread(ThreadFunction *Function, void *Argument, bool Detach); -ThreadHandle StartThread(ThreadFunction *Function, void *Argument, size_t StackSize, bool Detach); -ThreadHandle StartThread(ThreadFunction *Function, void *Argument, void *Stack, size_t StackSize, bool Detach); -int JoinThread(ThreadHandle Handle); -void DelayThread(int Seconds, int MicroSeconds); - -struct Semaphore { - Semaphore(int Value); - ~Semaphore(void); - void up(void); - void down(void); - - // DATA - // ================= - int value; - pthread_mutex_t mutex; - pthread_cond_t condition; -}; - -#endif //TIBIA_THREAD_HH_ -- cgit v1.2.3