]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr: safety checks on pyThreadState usage
authorJohn Spray <john.spray@redhat.com>
Tue, 3 Oct 2017 12:16:10 +0000 (08:16 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:26 +0000 (23:03 +0000)
commit66aa481be983fdd60beddc7ce621dad3edbf5490
treec8684d17f07ef67e4e38d3d7c741fcbec9593e84
parent385a6a0e8e6a6dd315ab358dcea7f3c069d9ad4d
mgr: safety checks on pyThreadState usage

Previously relied on the caller of Gil() to
pass new_thread=true if they would be
calling from a different thread.

Enforce this with an assertion, by wrapping
PyThreadState in a SafeThreadState class
that remembers which POSIX thread
it's meant to be used in.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 625e1b5cfb9b8a5843dfe75e97826f70a57d6ebe)
src/mgr/Gil.cc
src/mgr/Gil.h
src/mgr/MgrPyModule.cc
src/mgr/MgrPyModule.h
src/mgr/PyModules.cc
src/mgr/PyState.cc