Commit b7eddbf4 authored by Xavier Thompson's avatar Xavier Thompson

Avoid checking for nullpointers in automatic cypclass lock acquisition

parent f7c2c1ce
...@@ -14199,16 +14199,16 @@ class CoerceToLockedNode(CoercionNode): ...@@ -14199,16 +14199,16 @@ class CoerceToLockedNode(CoercionNode):
def generate_result_code(self, code): def generate_result_code(self, code):
# Acquire the lock. # Acquire the lock.
if self.rlock_only: if self.rlock_only:
code.putln("Cy_RLOCK(%s);" % self.result()) code.putln("%s->CyObject_RLOCK();" % self.result())
else: else:
code.putln("Cy_WLOCK(%s);" % self.result()) code.putln("%s->CyObject_WLOCK();" % self.result())
def generate_disposal_code(self, code): def generate_disposal_code(self, code):
# Release the lock. # Release the lock.
if self.rlock_only: if self.rlock_only:
code.putln("Cy_UNRLOCK(%s);" % self.result()) code.putln("%s->CyObject_UNRLOCK();" % self.result())
else: else:
code.putln("Cy_UNWLOCK(%s);" % self.result()) code.putln("%s->CyObject_UNWLOCK();" % self.result())
# The subexpressions of self.arg are disposed-of and freed # The subexpressions of self.arg are disposed-of and freed
# as soon as self.arg is evaluated because it is a temporary. # as soon as self.arg is evaluated because it is a temporary.
......
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