[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] [hotfix] Only release the lock if it is locked



commit 8cc1e691df2d481157e7d023c894eb9623fbe524
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Wed Dec 7 13:15:15 2016 +0000

    [hotfix] Only release the lock if it is locked
---
 ooni/agent/scheduler.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ooni/agent/scheduler.py b/ooni/agent/scheduler.py
index bda8510..262062e 100644
--- a/ooni/agent/scheduler.py
+++ b/ooni/agent/scheduler.py
@@ -88,7 +88,8 @@ class ScheduledTask(object):
         )
 
     def cancel(self):
-        self._last_run_lock.release()
+        if self._last_run_lock.locked:
+            self._last_run_lock.release()
 
     @property
     def should_run(self):



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits