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
856ccb56
Commit
856ccb56
authored
Mar 31, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make gevent.thread spawn Greenlets, not raw greenlets
parent
6d48a45a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
gevent/thread.py
gevent/thread.py
+3
-2
No files found.
gevent/thread.py
View file @
856ccb56
"""implements standard module 'thread' with greenlets"""
__thread
=
__import__
(
'thread'
)
from
gevent.hub
import
getcurrent
,
GreenletExit
,
spawn_raw
from
gevent.hub
import
getcurrent
,
GreenletExit
from
gevent.greenlet
import
Greenlet
from
gevent.coros
import
Semaphore
as
LockType
def
get_ident
(
gr
=
None
):
...
...
@@ -10,7 +11,7 @@ def get_ident(gr=None):
return
id
(
gr
)
def
start_new_thread
(
function
,
args
=
(),
kwargs
=
{}):
greenlet
=
spawn_raw
(
function
,
*
args
,
**
kwargs
)
greenlet
=
Greenlet
.
spawn
(
function
,
*
args
,
**
kwargs
)
return
get_ident
(
greenlet
)
def
allocate_lock
():
...
...
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