Revision
107
Author
robert@fledge.watson.org
Date
2009-11-03 08:18:18 -0800 (Tue, 03 Nov 2009)

Log Message

Use dispatch_atomic_inc() instead of Mac OS X atomic operations for
dispatch_apply so that it is portable.

Modified Paths

Diff

Modified: trunk/testing/Makefile.am (106 => 107)


--- trunk/testing/Makefile.am	2009-11-03 15:35:44 UTC (rev 106)
+++ trunk/testing/Makefile.am	2009-11-03 16:18:18 UTC (rev 107)
@@ -10,6 +10,7 @@
 if HAVE_BLOCKS
 BLOCKS_TESTS=				\
 	dispatch_after			\
+	dispatch_apply			\
 	dispatch_group			\
 	dispatch_pingpong		\
 	dispatch_read			\
@@ -33,7 +34,6 @@
 # features they depend on, or port them as required.
 #
 BROKEN_TESTS=				\
-	dispatch_apply			\
 	dispatch_cffd			\
 	dispatch_drift			\
 	dispatch_proc			\

Modified: trunk/testing/dispatch_apply.c (106 => 107)


--- trunk/testing/dispatch_apply.c	2009-11-03 15:35:44 UTC (rev 106)
+++ trunk/testing/dispatch_apply.c	2009-11-03 16:18:18 UTC (rev 107)
@@ -19,11 +19,11 @@
  */
 
 #include <dispatch/dispatch.h>
+#include "src/hw_shims.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <assert.h>
-#include <libkern/OSAtomic.h>
 
 #include "dispatch_test.h"
 
@@ -39,7 +39,7 @@
 	test_ptr_notnull("dispatch_get_concurrent_queue", queue);
 
 	dispatch_apply(final, queue, ^(size_t i __attribute__((unused))) {
-		OSAtomicIncrement32(&count);
+		dispatch_atomic_inc(&count);
 	});
 
 	test_long("count", count, final);