xref: /freebsd/contrib/llvm-project/lldb/bindings/interface/SBMutexExtensions.i (revision 700637cbb5e582861067a11aaca4d053546871d2)
1*700637cbSDimitry Andric %extend lldb::SBMutex {
2*700637cbSDimitry Andric #ifdef SWIGPYTHON
3*700637cbSDimitry Andric     %pythoncode %{
4*700637cbSDimitry Andric         def __enter__(self):
5*700637cbSDimitry Andric             self.lock()
6*700637cbSDimitry Andric             return self
7*700637cbSDimitry Andric 
8*700637cbSDimitry Andric         def __exit__(self, exc_type, exc_value, traceback):
9*700637cbSDimitry Andric             self.unlock()
10*700637cbSDimitry Andric     %}
11*700637cbSDimitry Andric #endif
12*700637cbSDimitry Andric }
13