Commit 6ec93025 authored by gsamain's avatar gsamain

Make with unlocked statement properly lock again when there is read and write needs

parent f19d0b27
...@@ -8269,10 +8269,10 @@ class LockCypclassNode(StatNode): ...@@ -8269,10 +8269,10 @@ class LockCypclassNode(StatNode):
# We must unlock if we held a lock previously, and relock if we unlocked. # We must unlock if we held a lock previously, and relock if we unlocked.
if self.state != "unlocked": if self.state != "unlocked":
code.putln("Cy_UNLOCK(%s);" % self.obj.result()) code.putln("Cy_UNLOCK(%s);" % self.obj.result())
elif self.was_rlocked:
code.putln("Cy_RLOCK(%s);" % self.obj.result())
elif self.was_wlocked: elif self.was_wlocked:
code.putln("Cy_WLOCK(%s);" % self.obj.result()) code.putln("Cy_WLOCK(%s);" % self.obj.result())
elif self.was_rlocked:
code.putln("Cy_RLOCK(%s);" % self.obj.result())
def cython_view_utility_code(): def cython_view_utility_code():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment