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
3d929998
Commit
3d929998
authored
Sep 15, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
thread: follow pep8
parent
471b085d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
gevent/thread.py
gevent/thread.py
+5
-1
No files found.
gevent/thread.py
View file @
3d929998
"""Implementation of the standard :mod:`thread` module that spawns greenlets.
.. note::
This module is a helper for :mod:`gevent.monkey` and is not intended to be
used directly. For spawning greenlets in your applications, prefer
:class:`Greenlet` class.
...
...
@@ -12,19 +12,23 @@ from gevent.hub import getcurrent, GreenletExit
from
gevent.greenlet
import
Greenlet
from
gevent.coros
import
Semaphore
as
LockType
def
get_ident
(
gr
=
None
):
if
gr
is
None
:
return
id
(
getcurrent
())
else
:
return
id
(
gr
)
def
start_new_thread
(
function
,
args
=
(),
kwargs
=
{}):
greenlet
=
Greenlet
.
spawn
(
function
,
*
args
,
**
kwargs
)
return
get_ident
(
greenlet
)
def
allocate_lock
():
return
LockType
(
1
)
def
exit
():
raise
GreenletExit
...
...
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