]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Thread: print msg on join errors
authorJohn Spray <john.spray@redhat.com>
Wed, 17 Jun 2015 10:50:40 +0000 (11:50 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 25 Jun 2015 15:19:24 +0000 (16:19 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/common/Thread.cc

index 07e12499be6530b1f6abd8669e95c06e94188cdf..3ec358acac4d8a56597e41c7c154b18e7b5e7bfe 100644 (file)
@@ -161,7 +161,14 @@ int Thread::join(void **prval)
   }
 
   int status = pthread_join(thread_id, prval);
-  assert(status == 0);
+  if (status != 0) {
+    char buf[256];
+    snprintf(buf, sizeof(buf), "Thread::join(): pthread_join "
+             "failed with error %d\n", status);
+    dout_emergency(buf);
+    assert(status == 0);
+  }
+
   thread_id = 0;
   return status;
 }