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:
crs
2002-06-02 18:49:35 +00:00
parent 1da9be88c9
commit 1d3807cb0e
7 changed files with 115 additions and 25 deletions

View File

@@ -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)