rw_semaphore: dont include debug-util.h when not necessary

Just avoids an unnecessary include which was making my compilation slow
down every time I modified debug-util.h.

Change-Id: I8a194bbffbe413eaffe0449639e3b4aa35a89900
Reviewed-on: http://gerrit.cloudera.org:8080/9328
Reviewed-by: Mike Percy <mpe...@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/ab6296fd
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/ab6296fd
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/ab6296fd

Branch: refs/heads/master
Commit: ab6296fdd3d852d20845565884b34880c5db5320
Parents: 6309fb1
Author: Todd Lipcon <t...@apache.org>
Authored: Wed Feb 14 14:42:49 2018 -0800
Committer: Todd Lipcon <t...@apache.org>
Committed: Fri Feb 23 02:50:57 2018 +0000

----------------------------------------------------------------------
 src/kudu/util/rw_semaphore.h | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/ab6296fd/src/kudu/util/rw_semaphore.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/rw_semaphore.h b/src/kudu/util/rw_semaphore.h
index de0bb59..20c0b57 100644
--- a/src/kudu/util/rw_semaphore.h
+++ b/src/kudu/util/rw_semaphore.h
@@ -17,14 +17,18 @@
 #ifndef KUDU_UTIL_RW_SEMAPHORE_H
 #define KUDU_UTIL_RW_SEMAPHORE_H
 
+// Uncomment for extra debugging information. See below for details.
+//   #define RW_SEMAPHORE_TRACK_HOLDER 1
+
 #include <boost/smart_ptr/detail/yield_k.hpp>
 #include <glog/logging.h>
 
 #include "kudu/gutil/atomicops.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/gutil/port.h"
+#ifdef RW_SEMAPHORE_TRACK_HOLDER
 #include "kudu/util/debug-util.h"
-
+#endif
 #include "kudu/util/thread.h"
 
 namespace kudu {
@@ -53,10 +57,9 @@ namespace kudu {
 //
 // In order to support easier debugging of leaked locks, this class can track
 // the stack trace of the last thread to lock it in write mode. To do so,
-// uncomment the following define:
-//   #define RW_SEMAPHORE_TRACK_HOLDER 1
-// ... and then in gdb, print the contents of the semaphore, and you should
-// see the collected stack trace.
+// uncomment the definition of RW_SEMAPHORE_TRACK_HOLDER at the top of this
+// file. Then, in gdb, print the contents of the semaphore, and you should see
+// the collected stack trace.
 class rw_semaphore {
  public:
   rw_semaphore() : state_(0) {

Reply via email to