Browse Source

[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.
Mukund Sivaraman 12 years ago
parent
commit
8b19f3a80a
2 changed files with 8 additions and 6 deletions
  1. 2 0
      src/lib/util/threads/sync.cc
  2. 6 6
      src/lib/util/threads/sync.h

+ 2 - 0
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 <exceptions/exceptions.h>

+ 6 - 6
src/lib/util/threads/sync.h

@@ -15,8 +15,6 @@
 #ifndef B10_THREAD_SYNC_H
 #define B10_THREAD_SYNC_H
 
-#include "config.h"
-
 #include <boost/noncopyable.hpp>
 
 #include <cstdlib> // 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();