#include "common/LogClient.h"
#include "common/ceph_mutex.h"
+#include "common/fair_mutex.h"
#include "common/Timer.h"
#include "include/Context.h"
#include "include/types.h"
* also check the `stopping` flag. If stopping is true, you
* must either do nothing and immediately drop the lock, or
* never drop the lock again (i.e. call respawn()) */
- ceph::mutex mds_lock = ceph::make_mutex("MDSDaemon::mds_lock");
+ ceph::fair_mutex mds_lock{"MDSDaemon::mds_lock"};
bool stopping = false;
- SafeTimer timer;
+ class CommonSafeTimer<ceph::fair_mutex> timer;
std::string gss_ktfile_client{};
int orig_argc;
MDSRank::MDSRank(
mds_rank_t whoami_,
- ceph::mutex &mds_lock_,
+ ceph::fair_mutex &mds_lock_,
LogChannelRef &clog_,
- SafeTimer &timer_,
+ CommonSafeTimer<ceph::fair_mutex> &timer_,
Beacon &beacon_,
std::unique_ptr<MDSMap>& mdsmap_,
Messenger *msgr,
MDSRankDispatcher::MDSRankDispatcher(
mds_rank_t whoami_,
- ceph::mutex &mds_lock_,
+ ceph::fair_mutex &mds_lock_,
LogChannelRef &clog_,
- SafeTimer &timer_,
+ CommonSafeTimer<ceph::fair_mutex> &timer_,
Beacon &beacon_,
std::unique_ptr<MDSMap> &mdsmap_,
Messenger *msgr,
#include "common/DecayCounter.h"
#include "common/LogClient.h"
#include "common/Timer.h"
+#include "common/fair_mutex.h"
#include "common/TrackedOp.h"
+#include "common/ceph_mutex.h"
#include "include/common_fwd.h"
MDSRank(
mds_rank_t whoami_,
- ceph::mutex &mds_lock_,
+ ceph::fair_mutex &mds_lock_,
LogChannelRef &clog_,
- SafeTimer &timer_,
+ CommonSafeTimer<ceph::fair_mutex> &timer_,
Beacon &beacon_,
std::unique_ptr<MDSMap> & mdsmap_,
Messenger *msgr,
// Reference to global MDS::mds_lock, so that users of MDSRank don't
// carry around references to the outer MDS, and we can substitute
// a separate lock here in future potentially.
- ceph::mutex &mds_lock;
+ ceph::fair_mutex &mds_lock;
// Reference to global cluster log client, just to avoid initialising
// a separate one here.
// Reference to global timer utility, because MDSRank and MDSDaemon
// currently both use the same mds_lock, so it makes sense for them
// to share a timer.
- SafeTimer &timer;
+ CommonSafeTimer<ceph::fair_mutex> &timer;
std::unique_ptr<MDSMap> &mdsmap; /* MDSDaemon::mdsmap */
void signal() {cond.notify_all();}
private:
MDSRank *mds;
- ceph::condition_variable cond;
+ std::condition_variable_any cond;
} progress_thread;
class C_MDS_StandbyReplayRestart;
public:
MDSRankDispatcher(
mds_rank_t whoami_,
- ceph::mutex &mds_lock_,
+ ceph::fair_mutex &mds_lock_,
LogChannelRef &clog_,
- SafeTimer &timer_,
+ CommonSafeTimer<ceph::fair_mutex> &timer_,
Beacon &beacon_,
std::unique_ptr<MDSMap> &mdsmap_,
Messenger *msgr,