11 #ifndef ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP 12 #define ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_PTHREADS) 32 class posix_signal_blocker
37 posix_signal_blocker()
41 sigfillset(&new_mask);
42 blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0);
46 ~posix_signal_blocker()
49 pthread_sigmask(SIG_SETMASK, &old_mask_, 0);
58 sigfillset(&new_mask);
59 blocked_ = (pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask_) == 0);
67 blocked_ = (pthread_sigmask(SIG_SETMASK, &old_mask_, 0) != 0);
83 #endif // defined(ASIO_HAS_PTHREADS) 85 #endif // ASIO_DETAIL_POSIX_SIGNAL_BLOCKER_HPP