[Libdispatch-changes] [8] trunk/src

source_changes at macosforge.org source_changes at macosforge.org
Thu Sep 10 16:26:19 PDT 2009


Revision: 8
          http://trac.macosforge.org/projects/libdispatch/changeset/8
Author:   kvv at apple.com
Date:     2009-09-05 14:03:06 -0700 (Sat, 05 Sep 2009)
Log Message:
-----------
Additional __BLOCKS__ and DISPATCH_NO_LEGACY markup.

Modified Paths:
--------------
    trunk/src/legacy.c
    trunk/src/queue.c
    trunk/src/source.c

Modified: trunk/src/legacy.c
===================================================================
--- trunk/src/legacy.c	2009-09-05 19:49:28 UTC (rev 7)
+++ trunk/src/legacy.c	2009-09-05 21:03:06 UTC (rev 8)
@@ -26,10 +26,12 @@
  * earlier revision of the API. These interfaces WILL be removed in the future.
  */
 
+#ifdef __BLOCKS__
 DISPATCH_PUBLIC_API DISPATCH_NONNULL1 DISPATCH_NONNULL2
 dispatch_item_t
 LEGACY_dispatch_call(dispatch_queue_t, dispatch_legacy_block_t work, dispatch_legacy_block_t completion)
 __asm__("_dispatch_call2");
+#endif
 
 DISPATCH_PUBLIC_API DISPATCH_PURE DISPATCH_WARN_RESULT
 dispatch_queue_t
@@ -44,6 +46,7 @@
 	return _dispatch_queue_get_current();
 }
 
+#ifdef __BLOCKS__
 dispatch_item_t
 LEGACY_dispatch_call(dispatch_queue_t dq,
 	dispatch_legacy_block_t dispatch_block,
@@ -78,7 +81,10 @@
 
 	return di;
 }
+#endif /* __BLOCKS__ */
 
+#ifndef DISPATCH_NO_LEGACY
+
 sigset_t
 dispatch_event_get_signals(dispatch_event_t de)
 {
@@ -442,3 +448,5 @@
 	return _dispatch_source_create2(ds, attr, ctxt, func);
 }
 
+#endif /* DISPATCH_NO_LEGACY */
+

Modified: trunk/src/queue.c
===================================================================
--- trunk/src/queue.c	2009-09-05 19:49:28 UTC (rev 7)
+++ trunk/src/queue.c	2009-09-05 21:03:06 UTC (rev 8)
@@ -562,11 +562,15 @@
 		}
 #endif
 	}
+#else
+	(void)attr;
 #endif
 
 	return dq;
 
+#if !defined(DISPATCH_NO_LEGACY) && defined(__BLOCKS__)
 out_bad:
+#endif
 	free(dq);
 	return NULL;
 }
@@ -1481,6 +1485,7 @@
 }
 #endif
 
+#ifndef DISPATCH_NO_LEGACY
 static void
 dispatch_queue_attr_dispose(dispatch_queue_attr_t attr)
 {
@@ -1568,6 +1573,7 @@
 	return 0;
 }
 #endif
+#endif /* DISPATCH_NO_LEGACY */
 
 static void
 _dispatch_ccache_init(void *context __attribute__((unused)))

Modified: trunk/src/source.c
===================================================================
--- trunk/src/source.c	2009-09-05 19:49:28 UTC (rev 7)
+++ trunk/src/source.c	2009-09-05 21:03:06 UTC (rev 8)
@@ -1080,6 +1080,7 @@
 	return NULL;
 }
 
+#ifdef __BLOCKS__
 // 6618342 Contact the team that owns the Instrument DTrace probe before renaming this symbol
 static void
 _dispatch_source_set_event_handler2(void *context)
@@ -1105,6 +1106,7 @@
 	dispatch_barrier_async_f((dispatch_queue_t)ds,
 		handler, _dispatch_source_set_event_handler2);
 }
+#endif /* __BLOCKS__ */
 
 static void
 _dispatch_source_set_event_handler_f(void *context)
@@ -1112,9 +1114,11 @@
 	dispatch_source_t ds = (dispatch_source_t)_dispatch_queue_get_current();
 	dispatch_assert(ds->do_vtable == &_dispatch_source_kevent_vtable);
 	
+#ifdef __BLOCKS__
 	if (ds->ds_handler_is_block && ds->ds_handler_ctxt) {
 		Block_release(ds->ds_handler_ctxt);
 	}
+#endif
 	ds->ds_handler_func = context;
 	ds->ds_handler_ctxt = ds->do_ctxt;
 	ds->ds_handler_is_block = false;
@@ -1129,6 +1133,7 @@
 		handler, _dispatch_source_set_event_handler_f);
 }
 
+#ifdef __BLOCKS__
 // 6618342 Contact the team that owns the Instrument DTrace probe before renaming this symbol
 static void
 _dispatch_source_set_cancel_handler2(void *context)
@@ -1152,6 +1157,7 @@
 	dispatch_barrier_async_f((dispatch_queue_t)ds,
 							 handler, _dispatch_source_set_cancel_handler2);
 }
+#endif /* __BLOCKS__ */
 
 static void
 _dispatch_source_set_cancel_handler_f(void *context)
@@ -1159,9 +1165,11 @@
 	dispatch_source_t ds = (dispatch_source_t)_dispatch_queue_get_current();
 	dispatch_assert(ds->do_vtable == &_dispatch_source_kevent_vtable);
 	
+#ifdef __BLOCKS__
 	if (ds->ds_cancel_is_block && ds->ds_cancel_handler) {
 		Block_release(ds->ds_cancel_handler);
 	}
+#endif
 	ds->ds_cancel_handler = context;
 	ds->ds_cancel_is_block = false;
 }
@@ -1239,7 +1247,9 @@
 
 	return ds;
 
+#ifdef __BLOCKS__
 out_bad:
+#endif
 	free(ds);
 	return NULL;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-changes/attachments/20090910/9d974a4b/attachment-0001.html>


More information about the Libdispatch-changes mailing list