Commit 576f8f56 authored by Denis Bilenko's avatar Denis Bilenko

replace get_hub().switch() with self.parent.switch - should be faster as it...

replace get_hub().switch() with self.parent.switch - should be faster as it avoids accessing threadlocal
parent b3a3d242
......@@ -316,7 +316,7 @@ class Greenlet(greenlet):
try:
t = Timeout.start_new(timeout)
try:
result = get_hub().switch()
result = self.parent.switch()
assert result is self, 'Invalid switch into Greenlet.get(): %r' % (result, )
finally:
t.cancel()
......@@ -348,7 +348,7 @@ class Greenlet(greenlet):
try:
t = Timeout.start_new(timeout)
try:
result = get_hub().switch()
result = self.parent.switch()
assert result is self, 'Invalid switch into Greenlet.join(): %r' % (result, )
finally:
t.cancel()
......
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