class_docstr: Threading lock that raises an exception for reentrant calls.
  
  Calls from different threads are serialized, and nested calls from the
  same thread result to an error.
  
  The object can be used as a context manager, or to decorate functions
  via the decorate() method.
class_docstr_tok: ["Threading","lock","that","raises","an","exception","for","reentrant","calls",".","Calls","from","different","threads","are","serialized",",","and","nested","calls","from","the","same","thread","result","to","an","error",".","The","object","can","be","used","as","a","context","manager",",","or","to","decorate","functions","via","the","decorate","(",")","method","."]
code: def __init__(self, err_msg):
      self._rlock = threading.RLock()
      self._entered = False
      self._err_msg = err_msg
  
file_path: catboost/contrib/python/scipy/py2/scipy/_lib/_threadsafety.py
imports: from __future__ import division, print_function, absolute_import
  import threading
  import scipy._lib.decorator
label_desc: Use image node_id 1 to create a new ReentrancyLock object from inherited base classes: object with example: obj = ReentrancyLock(err_msg)