]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/Thread: make _entry_func noexcept
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 11 Jan 2021 20:40:43 +0000 (15:40 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 11 Jan 2021 21:05:22 +0000 (16:05 -0500)
commit41142c93a727ed0be73178271169bd0a5cdbe206
tree72f75fa8cad6329624bc1295673b614937ea84c4
parente08b7a4aacf33b29b600db3b5878763c4e261b2b
common/Thread: make _entry_func noexcept

Under the GNU system, thread cancellation takes the form of an
exception thrown from the cancellation point, so that the stack
unwinds and destructors are called. The thread entrypoints thus have
what is effectively a catch (...) that terminates on everything but
the thread cancellation exception.

Unfortunately this means the stack has been unwound and we have no
backtrace with which to debug.

Wrapping the actual entry point in noexcept means we call terminate
and get our backtrace as soon as the exception is thrown, assuming it
doesn't get caught by something in the middle.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/common/Thread.cc
src/common/Thread.h