Commit ff5b9c36 authored by Stefan Behnel's avatar Stefan Behnel

Add comment to explain why "better" GIL handling is not needed in special...

Add comment to explain why "better" GIL handling is not needed in special methods (because it's held anyway).
parent ec703e63
......@@ -2184,7 +2184,7 @@ class FuncDefNode(StatNode, BlockNode):
if self.entry.is_special and self.entry.name == "__hash__":
# Returning -1 for __hash__ is supposed to signal an error
# We do as Python instances and coerce -1 into -2.
assure_gil('success')
assure_gil('success') # in special methods, the GIL is owned anyway
code.putln("if (unlikely(%s == -1) && !PyErr_Occurred()) %s = -2;" % (
Naming.retval_cname, Naming.retval_cname))
......
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