X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Ffibers%2FTimedMutex.h;h=671409a0c39364b1f08da8fb7d69e8d434c78619;hp=7c42b8b0397791ca58ea691c86209e4400290d0a;hb=214b26f334d1a06515211918fc4a760ae50e6a33;hpb=62134365a855a63a9dc1b8317ce44a4dd8430859 diff --git a/folly/fibers/TimedMutex.h b/folly/fibers/TimedMutex.h index 7c42b8b0..671409a0 100644 --- a/folly/fibers/TimedMutex.h +++ b/folly/fibers/TimedMutex.h @@ -15,8 +15,6 @@ */ #pragma once -#include - #include #include #include @@ -93,13 +91,8 @@ class TimedMutex { template class TimedRWMutex { public: - TimedRWMutex() { - pthread_spin_init(&lock_, PTHREAD_PROCESS_PRIVATE); - } - - ~TimedRWMutex() { - pthread_spin_destroy(&lock_); - } + TimedRWMutex() = default; + ~TimedRWMutex() = default; TimedRWMutex(const TimedRWMutex& rhs) = delete; TimedRWMutex& operator=(const TimedRWMutex& rhs) = delete; @@ -223,7 +216,7 @@ class TimedRWMutex { boost::intrusive::constant_time_size> MutexWaiterList; - pthread_spinlock_t lock_; //< lock protecting the internal state + folly::SpinLock lock_; //< lock protecting the internal state // (state_, read_waiters_, etc.) State state_ = State::UNLOCKED;