]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/thread: Fix race condition in make_named_thread
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 22 Oct 2019 15:39:20 +0000 (11:39 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 31 Oct 2019 20:24:01 +0000 (21:24 +0100)
commiteed8d5eabb579daad89c12ad8a5797ac5fb9876d
tree25bfbb232ed5684bb34c68fc0baac4ccbdc61eba
parente78341bbc37b98b235a448dbd745ab7c77054a31
common/thread: Fix race condition in make_named_thread

The thread may well no longer exist by the time we try to set the
name, so have the thread set its own name first thing.

Thanks to Ilya Dryomov <idryomov@gmail.com> for pointing it out.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 2bd106ec0da52e7fcf616d7b3cb20d570c1a5c50)
src/common/Thread.h