]> 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)
committerNathan Cutler <ncutler@suse.com>
Tue, 29 Oct 2019 11:10:36 +0000 (12:10 +0100)
commit98cb958fc1c712880b70b3a5fa40527e39d11b2a
treec8da1f4800e48edb8da55e9058707aecefc97f65
parent05479e8a5a310bd7b03e35cd92d508788a4f5aff
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