Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
diff --git a/Lib/threading.py b/Lib/threading.py
index eb3cb62..28c2146 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -157,6 +157,8 @@
     def _release_save(self):
         if __debug__:
             self._note("%s._release_save()", self)
+        if self._count == 0:
+            raise RuntimeError("cannot release un-acquired lock")
         count = self._count
         self._count = 0
         owner = self._owner