Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.1.0
-
Fix Version/s: None
-
Component/s: Server
-
Labels:None
Description
The implementation of ConditionVariable class in RS is somewhat weird.
private: // pthread mutex object that is used with cond_. This is internal // and not the mutex the caller passes in. pthread_mutex_t mutex_; pthread_cond_t cond_;
This is quite the opposite of what it should be and what other components are using (correctly). This causes extra locks and unlocks on potentially hot path, which is at best inefficient. Also this causes the user to be extra careful because the original lock is dropped in the Wait method.
The condor should be using the same lock that is used to protect the code.