FOLLY_ALWAYS_INLINE void unlock() const {
lock_.unlock();
}
- FOLLY_ALWAYS_INLINE bool trylock() const {
+ FOLLY_ALWAYS_INLINE bool try_lock() const {
return lock_.try_lock();
}
private:
FOLLY_ALWAYS_INLINE void unlock() const {
OSSpinLockUnlock(&lock_);
}
- FOLLY_ALWAYS_INLINE bool trylock() const {
+ FOLLY_ALWAYS_INLINE bool try_lock() const {
return OSSpinLockTry(&lock_);
}
private:
int rc = pthread_spin_unlock(&lock_);
checkPosixError(rc, "error unlocking spinlock");
}
- FOLLY_ALWAYS_INLINE bool trylock() const {
+ FOLLY_ALWAYS_INLINE bool try_lock() const {
int rc = pthread_spin_trylock(&lock_);
if (rc == 0) {
return true;
int rc = pthread_mutex_unlock(&lock_);
checkPosixError(rc, "error unlocking mutex");
}
- FOLLY_ALWAYS_INLINE bool trylock() const {
+ FOLLY_ALWAYS_INLINE bool try_lock() const {
int rc = pthread_mutex_trylock(&lock_);
if (rc == 0) {
return true;