Add parameter non_block (defaults to false) on SizedQueue#push
The implementations of Queue and SizedQueue have a method pop, where a parameter non_block would make the call raise a ThreadError if the queue is empty. Since popping of an empty queue is comparable with pushing to a full SizedQueue, I guess it would be nice to have an optional second parameter to make SizedQueue#push optional non-blocking too.
Updated by herwinw (Herwin Quarantainenet) over 6 years ago
The following patch should do the trick.
Another thing to consider in this file: don't mix up tabs and spaces. The indention is completely gone when viewing with a tabstop < 8.
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r46852.
thread/thread.c: non-blocking push on SizedQueue
- ext/thread/thread.c (rb_szqueue_push): add optional parameter, non_block defaulted to false. [ruby-core:63794] [Feature #10052]