Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(188)

Delta Between Two Patch Sets: Lib/queue.py

Issue 22043: Use a monotonic clock to compute timeouts
Left Patch Set: Created 3 years ago
Right Patch Set: Created 3 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Include/pytime.h ('k') | Lib/sched.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 '''A multi-producer, multi-consumer queue.''' 1 '''A multi-producer, multi-consumer queue.'''
2 2
3 try: 3 try:
4 import threading 4 import threading
5 except ImportError: 5 except ImportError:
6 import dummy_threading as threading 6 import dummy_threading as threading
7 from collections import deque 7 from collections import deque
8 from heapq import heappush, heappop 8 from heapq import heappush, heappop
9 from time import monotonic as time 9 from time import monotonic as time
10 10
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 self.queue = [] 237 self.queue = []
238 238
239 def _qsize(self): 239 def _qsize(self):
240 return len(self.queue) 240 return len(self.queue)
241 241
242 def _put(self, item): 242 def _put(self, item):
243 self.queue.append(item) 243 self.queue.append(item)
244 244
245 def _get(self): 245 def _get(self):
246 return self.queue.pop() 246 return self.queue.pop()
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7