]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
simplemessenger: Fix num_threads bug printout.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 16 Feb 2011 23:07:01 +0000 (15:07 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 16 Feb 2011 23:07:01 +0000 (15:07 -0800)
Also add documentation to get_num_threads since its contract
changed significantly.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/common/Thread.cc
src/msg/SimpleMessenger.cc

index 148a6caa51aed1736438373f56570ef57caa50d6..5acf1d09d85dd3e6e7a1c3558691ce6304c89c70 100644 (file)
 #include "common/debug.h"
 #include "common/Thread.h"
 
+/**
+ * Return the number of threads in this process. The data is
+ * retrieved from /proc and includes all threads, not just
+ * "child" threads.
+ * Behavior changed in 6fb416b083d518e5f524359cc3cacb66ccc63dca
+ * to support eventual elimination of global variables.
+ */
 int Thread::get_num_threads(void)
 {
   std::ostringstream oss;
index 6c9e0b333db4b49f24c7edfcca0508f2d8bb3094..fd44face98d4ad6a3f53cab052535cb723750cc6 100644 (file)
@@ -2429,8 +2429,8 @@ int SimpleMessenger::start(bool nodaemon)
   if (g_conf.daemonize && !nodaemon) {
     int num_threads = Thread::get_num_threads();
     if (num_threads > 1) {
-      derr << "messenger.start BUG: there are " << num_threads << " threads"
-          << " already started that will now die!  call messenger.start() sooner."
+      derr << "messenger.start BUG: there are " << num_threads - 1
+           << " child threads already started that will now die!  call messenger.start() sooner."
           << dendl;
     }