Exemplo n.º 1
0
    def test_get_instance_with_concurrent_mode(self, mr_rlock: RLockFactory):
        try:
            _rlock = mr_rlock.get_instance()
        except ValueError as ve:
            assert "FeatureMode is None. Please configure it as one of 'multirunnable.mode.FeatureMode'." in str(
                ve), "It should set the FeatureMode first."

        mr_rlock.feature_mode = FeatureMode.Concurrent
        _rlock = mr_rlock.get_instance()
        from threading import RLock
        assert _rlock is not None and isinstance(_rlock, type(RLock(
        ))) is True, "This type of RLock instance should be 'threading.RLock'."
Exemplo n.º 2
0
def RLock():
    """
    Returns a recursive lock object
    """
    from multiprocessing.synchronize import RLock
    return RLock()
Exemplo n.º 3
0
def RLock():
    from multiprocessing.synchronize import RLock
    return RLock()
Exemplo n.º 4
0
 def __init__(self):
     '''Constructor of Logger.'''
     self.lock = RLock()