/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * uTest, libtest
*
- * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * Data Differential YATL (i.e. libtest) library
+ *
+ * Copyright (C) 2012 Data Differential, http://datadifferential.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
*
*/
-
#pragma once
#include <pthread.h>
#include <semaphore.h>
+#include <signal.h>
enum shutdown_t {
SHUTDOWN_RUNNING,
volatile shutdown_t __shutdown;
pthread_mutex_t shutdown_mutex;
pthread_t thread;
+ sigset_t original_set;
public:
SignalThread();
+ ~SignalThread();
void test();
void post();
bool setup();
+ bool unblock();
int wait(int& sig)
{
return sigwait(&set, &sig);
}
- ~SignalThread()
- {
- sem_destroy(&lock);
- }
-
void set_shutdown(shutdown_t arg);
bool is_shutdown();
shutdown_t get_shutdown();