git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10531
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
+#include <unistd.h> /* usleep() */
#include "../../config.h"
#include "../../drd/drd.h"
;
if (p->writer_count == 0)
break;
+#ifdef __APPLE__
+ /* Darwin doesn't have an implementation of pthread_yield(). */
+ usleep(100 * 1000);
+#else
pthread_yield();
+#endif
__sync_fetch_and_sub(&p->locked, 1);
}
p->reader_count++;
;
if (p->reader_count == 0)
break;
+#ifdef __APPLE__
+ /* Darwin doesn't have an implementation of pthread_yield(). */
+ usleep(100 * 1000);
+#else
pthread_yield();
+#endif
__sync_fetch_and_sub(&p->locked, 1);
}
p->writer_count++;