[macruby-changes] [3270] MacRuby/trunk/gcd.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 13 17:37:23 PST 2010


Revision: 3270
          http://trac.macosforge.org/projects/ruby/changeset/3270
Author:   ernest.prabhakar at gmail.com
Date:     2010-01-13 17:37:22 -0800 (Wed, 13 Jan 2010)
Log Message:
-----------
Completed rdoc info for gcd.c -> Dispatch

Modified Paths:
--------------
    MacRuby/trunk/gcd.c

Modified: MacRuby/trunk/gcd.c
===================================================================
--- MacRuby/trunk/gcd.c	2010-01-13 23:03:05 UTC (rev 3269)
+++ MacRuby/trunk/gcd.c	2010-01-14 01:37:22 UTC (rev 3270)
@@ -455,6 +455,18 @@
     return Qnil;
 }
 
+ static void
+ rb_queue_applier(void *data, size_t ii)
+ {
+     assert(data != NULL);
+     rb_vm_block_t *block = rb_vm_uncache_or_dup_block((rb_vm_block_t *)data);
+ #if !GCD_BLOCKS_COPY_DVARS
+     rb_vm_block_make_detachable_proc(block);
+ #endif
+     VALUE num = SIZET2NUM(ii);
+     rb_vm_block_eval(block, 1, &num);
+ }
+
 /* 
  *  call-seq:
  *    gcdq.apply(count) { |index| block }
@@ -468,18 +480,6 @@
  *     p @result  #=> [0, 1, 4, 9, 16, 25]
  *
  */
- 
-static void
-rb_queue_applier(void *data, size_t ii)
-{
-    assert(data != NULL);
-    rb_vm_block_t *block = rb_vm_uncache_or_dup_block((rb_vm_block_t *)data);
-#if !GCD_BLOCKS_COPY_DVARS
-    rb_vm_block_make_detachable_proc(block);
-#endif
-    VALUE num = SIZET2NUM(ii);
-    rb_vm_block_eval(block, 1, &num);
-}
 
 static VALUE
 rb_queue_apply(VALUE self, SEL sel, VALUE n)
@@ -895,6 +895,19 @@
     return Qnil;
 }
 
+/* 
+ *  call-seq:
+ *    src.cancel!
+ *
+ *  Asynchronously cancels the dispatch source, preventing any further
+ *  invocation of its event handler block. Cancellation does not interrupt a
+ *  currently executing handler block (non-preemptive).
+ *
+ * When a dispatch source is canceled its cancellation handler will be submitted
+ * to its target queue. In MacRuby, this is only done for Dispatch::FileSource,
+ * which automatically sets a cancellation handler to close the File object.
+ */
+
 static VALUE
 rb_source_cancel(VALUE self, SEL sel)
 {
@@ -902,6 +915,14 @@
     return Qnil;
 }
 
+/* 
+ *  call-seq:
+ *    src.cancelled?
+ *
+ *  Used to determine whether the specified source has been cancelled.
+ *  True will be returned if the source is cancelled.
+ */
+
 static VALUE
 rb_source_cancelled_p(VALUE self, SEL sel)
 {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100113/0b829b1a/attachment.html>


More information about the macruby-changes mailing list