mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 06:31:50 +08:00
added SIGINT and SIGTERM handling to unix client and server.
either signal causes the main thread to be cancelled. added necessary code to make main thread cancellation clean up nicely.
This commit is contained in:
@@ -85,6 +85,7 @@ private:
|
||||
#if defined(CONFIG_PTHREADS)
|
||||
static void* threadFunc(void* arg);
|
||||
static void threadCancel(int);
|
||||
static void* threadSignalHandler(void*);
|
||||
#elif defined(CONFIG_PLATFORM_WIN32)
|
||||
static unsigned int __stdcall threadFunc(void* arg);
|
||||
#endif
|
||||
@@ -107,11 +108,13 @@ private:
|
||||
void* m_result;
|
||||
bool m_cancellable;
|
||||
bool m_cancelling;
|
||||
UInt32 m_signals;
|
||||
|
||||
#if defined(CONFIG_PTHREADS)
|
||||
pthread_t m_thread;
|
||||
bool m_exit;
|
||||
bool m_cancel;
|
||||
static pthread_t s_signalThread;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PLATFORM_WIN32)
|
||||
|
||||
Reference in New Issue
Block a user