Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
31834285
Commit
31834285
authored
Apr 09, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify that put *blocks* when the queue is full. Add some blank
lines to doc strings.
parent
c3baeecf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
Lib/Queue.py
Lib/Queue.py
+6
-1
No files found.
Lib/Queue.py
View file @
31834285
...
...
@@ -44,7 +44,10 @@ class Queue:
return
n
def
put
(
self
,
item
):
"""Put an item into the queue."""
"""Put an item into the queue.
If the queue is full, block until a free slot is avaiable.
"""
self
.
fsema
.
acquire_lock
()
self
.
mutex
.
acquire_lock
()
was_empty
=
self
.
_empty
()
...
...
@@ -57,6 +60,7 @@ class Queue:
def
get
(
self
):
"""Gets and returns an item from the queue.
This method blocks if necessary until an item is available.
"""
self
.
esema
.
acquire_lock
()
...
...
@@ -74,6 +78,7 @@ class Queue:
# raise Empty if the queue is empty or temporarily unavailable
def
get_nowait
(
self
):
"""Gets and returns an item from the queue.
Only gets an item if one is immediately available, Otherwise
this raises the Empty exception if the queue is empty or
temporarily unavailable.
...
...
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