Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
be76eb53
Commit
be76eb53
authored
Sep 15, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread: add __implements__
parent
3d929998
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
gevent/thread.py
gevent/thread.py
+20
-3
No files found.
gevent/thread.py
View file @
be76eb53
...
...
@@ -7,7 +7,17 @@
:class:`Greenlet` class.
"""
__thread
=
__import__
(
'thread'
)
__implements__
=
[
'allocate_lock'
,
'get_ident'
,
'exit'
,
'LockType'
,
'stack_size'
,
'start_new_thread'
]
__imports__
=
[
'error'
]
__thread__
=
__import__
(
'thread'
)
error
=
__thread__
.
error
from
gevent.hub
import
getcurrent
,
GreenletExit
from
gevent.greenlet
import
Greenlet
from
gevent.coros
import
Semaphore
as
LockType
...
...
@@ -32,8 +42,10 @@ def allocate_lock():
def
exit
():
raise
GreenletExit
if
hasattr
(
__thread
,
'stack_size'
):
_original_stack_size
=
__thread
.
stack_size
if
hasattr
(
__thread__
,
'stack_size'
):
_original_stack_size
=
__thread__
.
stack_size
def
stack_size
(
size
=
None
):
if
size
is
None
:
return
_original_stack_size
()
...
...
@@ -42,5 +54,10 @@ if hasattr(__thread, 'stack_size'):
else
:
pass
# not going to decrease stack_size, because otherwise other greenlets in this thread will suffer
else
:
__implements__
.
remove
(
'stack_size'
)
__all__
=
__implements__
+
__imports__
# XXX interrupt_main, _local
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment