*/
#pragma once
-#include <pthread.h>
-
#include <folly/IntrusiveList.h>
#include <folly/SpinLock.h>
#include <folly/fibers/GenericBaton.h>
template <typename BatonType>
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;
boost::intrusive::constant_time_size<true>>
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;