X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fsignal.h;h=fd7e4a6d359287ba925a7607ba0e9033b14e89be;hb=bcf4f7d33fd0b0cb5bb599b300aa043effc62a33;hp=eb0928256683cebea29266f57131c0c8e086f540;hpb=04b8554c3724eae57fbd75dc6b3e69dca8b58187;p=m6w6%2Flibmemcached diff --git a/libtest/signal.h b/libtest/signal.h index eb092825..fd7e4a6d 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,10 +55,12 @@ 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(); @@ -69,11 +71,6 @@ public: return sigwait(&set, &sig); } - ~SignalThread() - { - sem_destroy(&lock); - } - void set_shutdown(shutdown_t arg); bool is_shutdown(); shutdown_t get_shutdown();