#include <signal.h>
#include <pthread.h>
+#include <mutex>
+
struct timespec;
// A thread class with start/stop and signal functionality.
// the file descriptor.
//
// If fd is -1, wait until a wakeup or timeout.
- // if timeout_ts is NULL, there is no timeout.
+ // if timeout_ts is nullptr, there is no timeout.
bool wait_for_activity(int fd, short events, const timespec *timeout_ts);
// Wait until a wakeup.
pthread_t worker_thread;
// Protects should_stop_status.
- pthread_mutex_t should_stop_mutex;
+ std::mutex should_stop_mutex;
// If this is set, the thread should return as soon as possible from do_work().
bool should_stop_status;