]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr: safety checks on pyThreadState usage 18093/head
authorJohn Spray <john.spray@redhat.com>
Tue, 3 Oct 2017 12:16:10 +0000 (08:16 -0400)
committerJohn Spray <john.spray@redhat.com>
Mon, 16 Oct 2017 11:06:23 +0000 (07:06 -0400)
commit625e1b5cfb9b8a5843dfe75e97826f70a57d6ebe
treef817bc213395c0ea407d78653429f2f7a3a8a555
parent23c3a075ee1a27e1b57fcb452a4d6ce53080264e
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>
src/mgr/Gil.cc
src/mgr/Gil.h
src/mgr/MgrPyModule.cc
src/mgr/MgrPyModule.h
src/mgr/PyModules.cc
src/mgr/PyState.cc