]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/PG: support is_locked() in non-debug mode
authorKefu Chai <kchai@redhat.com>
Sat, 20 Jul 2019 11:34:02 +0000 (19:34 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 3 Aug 2019 03:27:21 +0000 (11:27 +0800)
commit9eead2052b3a6c247b7173a6b0ec9d7c3f343e64
tree8c6bafc0cfea5e64cb63061ef754db24fca943e2
parentfbf91b4d03abd9dc53d631429f7cee5b356765e4
osd/PG: support is_locked() in non-debug mode

`PG` print details info in the prefix of logging messages if the PG is
being locked by current thread. but `ceph::mutex` is an alias of
`std::mutex` in non-debug mode, so neither `mutex::is_locked_by_me()` nor
`mutex::is_locked()` is supported in non-debug mode. to continue supporting
this feature, `PG::locked_by` is added to memorize the thread id of the owner
of the lock.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PG.cc
src/osd/PG.h