[macruby-changes] [5132] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 7 16:33:52 PST 2011


Revision: 5132
          http://trac.macosforge.org/projects/ruby/changeset/5132
Author:   lsansonetti at apple.com
Date:     2011-01-07 16:33:48 -0800 (Fri, 07 Jan 2011)
Log Message:
-----------
export an internal gcd api

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

Added Paths:
-----------
    MacRuby/trunk/gcd.h

Modified: MacRuby/trunk/gcd.c
===================================================================
--- MacRuby/trunk/gcd.c	2011-01-07 13:42:10 UTC (rev 5131)
+++ MacRuby/trunk/gcd.c	2011-01-08 00:33:48 UTC (rev 5132)
@@ -6,11 +6,10 @@
  * Copyright (C) 2009-2010, Apple Inc. All rights reserved.
  */
 
-#include "ruby/macruby.h"
-
 #define GCD_BLOCKS_COPY_DVARS 1
 
-#include <dispatch/dispatch.h>
+#include "ruby/macruby.h"
+#include "gcd.h"
 #include <unistd.h>
 #include "ruby/intern.h"
 #include "ruby/node.h"
@@ -117,6 +116,13 @@
     }
 }
 
+dispatch_queue_t
+rb_get_dispatch_queue_object(VALUE queue)
+{
+    Check_Queue(queue);
+    return (dispatch_queue_t)dispatch_object_imp((void *)queue, 0);
+}
+
 static inline void
 Check_Group(VALUE object)
 {

Added: MacRuby/trunk/gcd.h
===================================================================
--- MacRuby/trunk/gcd.h	                        (rev 0)
+++ MacRuby/trunk/gcd.h	2011-01-08 00:33:48 UTC (rev 5132)
@@ -0,0 +1,24 @@
+/*
+ * MacRuby API for Grand Central Dispatch.
+ *
+ * This file is covered by the Ruby license. See COPYING for more details.
+ * 
+ * Copyright (C) 2009-2010, Apple Inc. All rights reserved.
+ */
+
+#ifndef __GCD_H_
+#define __GCD_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#include <dispatch/dispatch.h>
+
+dispatch_queue_t rb_get_dispatch_queue_object(VALUE queue);
+
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
+#endif // __GCD_H_
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110107/454a5f30/attachment.html>


More information about the macruby-changes mailing list