summaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 22:59:32 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 22:59:32 +0000
commitfd7ac9f3c9e106a57869da762a383536636f0f3d (patch)
tree789de6699e492fc58b26531147b4c6065d4a7db5 /ChangeLog
parentb79d7910f5721b222443464ca576c5774c1a79ef (diff)
* thread_tools.c: add Queue#close(exception=false) and
SizedQueue#close(exception=false). [Feature #10600] Trying to deq from a closed empty queue return nil if exception parameter equals to false (default). If exception parameter is truthy, it raises ClosedQueueError (< StopIteration). ClosedQueueError inherits StopIteration so that you can write: loop{ e = q.deq; (using e) } Trying to close a closed queue raises ClosedQueueError. Blocking threads to wait deq for Queue and SizedQueue will be restarted immediately by returning nil (exception=false) or raising a ClosedQueueError (exception=true). Blocking threads to wait enq for SizedQueue will be restarted by raising a ClosedQueueError immediately. The above specification is not proposed specification, so that we need to continue discussion to conclude specification this method. * test/thread/test_queue.rb: add tests originally written by John Anderson and modify detailed behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog31
1 files changed, 31 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 215f9c051e..1005586840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+Thu Aug 27 07:45:34 2015 Koichi Sasada <ko1@atdot.net>
+
+ * thread_tools.c: add Queue#close(exception=false) and
+ SizedQueue#close(exception=false).
+ [Feature #10600]
+
+ Trying to deq from a closed empty queue return nil
+ if exception parameter equals to false (default).
+
+ If exception parameter is truthy, it raises
+ ClosedQueueError (< StopIteration).
+ ClosedQueueError inherits StopIteration so that you can write:
+
+ loop{ e = q.deq; (using e) }
+
+ Trying to close a closed queue raises ClosedQueueError.
+
+ Blocking threads to wait deq for Queue and SizedQueue will be
+ restarted immediately by returning nil (exception=false) or
+ raising a ClosedQueueError (exception=true).
+
+ Blocking threads to wait enq for SizedQueue will be
+ restarted by raising a ClosedQueueError immediately.
+
+ The above specification is not proposed specification, so that
+ we need to continue discussion to conclude specification this
+ method.
+
+ * test/thread/test_queue.rb: add tests originally written by
+ John Anderson and modify detailed behavior.
+
Wed Aug 26 10:52:02 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* re.c (rb_memsearch_wchar, rb_memsearch_qchar): test matching