runtime/race: do not include pthread.h

Fixes #4721.

R=alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/7275048
This commit is contained in:
Dmitriy Vyukov 2013-02-05 13:08:07 +04:00
parent e7fe1944ac
commit 6b1b613d6a
1 changed files with 2 additions and 12 deletions

View File

@ -5,26 +5,16 @@
package main
/*
#include <pthread.h>
pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
int sync;
void Notify(void)
{
pthread_mutex_lock(&mtx);
sync = 1;
pthread_cond_broadcast(&cv);
pthread_mutex_unlock(&mtx);
__sync_fetch_and_add(&sync, 1);
}
void Wait(void)
{
pthread_mutex_lock(&mtx);
while(sync == 0)
pthread_cond_wait(&cv, &mtx);
pthread_mutex_unlock(&mtx);
while(__sync_fetch_and_add(&sync, 0) == 0) {}
}
*/
import "C"