X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fsignal.h;h=6e68bb3878b0a289aafbe48fb0487b92ed4d04c4;hb=1f483f29cd415fdb749a5571d9e1483dd11a2ab0;hp=eb0928256683cebea29266f57131c0c8e086f540;hpb=3c4d734f56530d43520f385bff97162c04ac81ac;p=awesomized%2Flibmemcached diff --git a/libtest/signal.h b/libtest/signal.h index eb092825..6e68bb38 100644 --- a/libtest/signal.h +++ b/libtest/signal.h @@ -1,8 +1,8 @@ /* 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 @@ -34,11 +34,11 @@ * */ - #pragma once #include #include +#include enum shutdown_t { SHUTDOWN_RUNNING, @@ -55,25 +55,23 @@ class SignalThread { 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();