mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Added support for (optionally) bracketing calls with
Py_{BEGIN,END}_ALLOW_THREADS.
This commit is contained in:
parent
f3f231f60c
commit
b53355ad77
1 changed files with 8 additions and 0 deletions
|
@ -216,6 +216,12 @@ class FunctionGenerator(BaseFunctionGenerator):
|
||||||
def precheck(self):
|
def precheck(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def beginallowthreads(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def endallowthreads(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def callit(self):
|
def callit(self):
|
||||||
args = ""
|
args = ""
|
||||||
s = "%s%s(" % (self.getrvforcallit(), self.callname)
|
s = "%s%s(" % (self.getrvforcallit(), self.callname)
|
||||||
|
@ -226,8 +232,10 @@ class FunctionGenerator(BaseFunctionGenerator):
|
||||||
s = arg.passArgument()
|
s = arg.passArgument()
|
||||||
if args: s = sep + s
|
if args: s = sep + s
|
||||||
args = args + s
|
args = args + s
|
||||||
|
self.beginallowthreads()
|
||||||
Output("%s%s(%s);",
|
Output("%s%s(%s);",
|
||||||
self.getrvforcallit(), self.callname, args)
|
self.getrvforcallit(), self.callname, args)
|
||||||
|
self.endallowthreads()
|
||||||
|
|
||||||
def getrvforcallit(self):
|
def getrvforcallit(self):
|
||||||
if self.rv:
|
if self.rv:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue