From 8b19f3a80a57b4a0c41e58460920924d5613e606 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Tue, 23 Oct 2012 09:28:43 +0530 Subject: [PATCH] [2236] Remove config.h include from sync.h ... and move it to sync.cc. This is so that sync.h can be dist-ed. Also add comments to some methods that may not be available in non-debug builds. --- src/lib/util/threads/sync.cc | 2 ++ src/lib/util/threads/sync.h | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/util/threads/sync.cc b/src/lib/util/threads/sync.cc index 9c15f0378c..c2f4fed48c 100644 --- a/src/lib/util/threads/sync.cc +++ b/src/lib/util/threads/sync.cc @@ -12,6 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. +#include "config.h" + #include "sync.h" #include diff --git a/src/lib/util/threads/sync.h b/src/lib/util/threads/sync.h index 6a968df69d..87c78be94d 100644 --- a/src/lib/util/threads/sync.h +++ b/src/lib/util/threads/sync.h @@ -15,8 +15,6 @@ #ifndef B10_THREAD_SYNC_H #define B10_THREAD_SYNC_H -#include "config.h" - #include #include // for NULL. @@ -112,10 +110,11 @@ public: private: friend class CondVar; -#ifdef ENABLE_DEBUG - // Commonly called after acquiring the lock, checking and updating // internal state for debug. + // + // Note that this method is only available when the build is + // configured with debugging support. void postLockAction(); // Commonly called before releasing the lock, checking and updating @@ -125,10 +124,11 @@ private: // fails; otherwise it aborts the process. This parameter must be set // to false if the call to this shouldn't result in an exception (e.g. // when called from a destructor). + // + // Note that this method is only available when the build is + // configured with debugging support. void preUnlockAction(bool throw_ok); -#endif // ENABLE_DEBUG - class Impl; Impl* impl_; void lock();