Commit 91b962e3 authored by Maged Michael's avatar Maged Michael Committed by Facebook GitHub Bot

SharedMutex: Add build-time flags for setting default spin and yield counts

Summary: Add build-time flags for setting default spin and yield counts.

Reviewed By: fadimounir

Differential Revision: D30761279

fbshipit-source-id: 3b74bae438b1f87b1ca8b955bb244eb907b22891
parent 8ee373cf
......@@ -251,9 +251,19 @@ struct SharedMutexToken {
uint16_t slot_;
};
#ifndef FOLLY_SHARED_MUTEX_MAX_SPIN_DEFAULT
#define FOLLY_SHARED_MUTEX_MAX_SPIN_DEFAULT 2
#endif
#ifndef FOLLY_SHARED_MUTEX_MAX_YIELD_DEFAULT
#define FOLLY_SHARED_MUTEX_MAX_YIELD_DEFAULT 1
#endif
struct SharedMutexPolicyDefault {
static constexpr uint32_t max_spin_count = 2;
static constexpr uint32_t max_soft_yield_count = 1;
static constexpr uint32_t max_spin_count =
FOLLY_SHARED_MUTEX_MAX_SPIN_DEFAULT;
static constexpr uint32_t max_soft_yield_count =
FOLLY_SHARED_MUTEX_MAX_YIELD_DEFAULT;
static constexpr bool track_thread_id = false;
static constexpr bool skip_annotate_rwlock = false;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment