./nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed

#include
#include
#include
#include
#include
#include

using namespace std;
pthread_cond_t taxiarrive = PTHREAD_COND_INITIALIZER;
//int pci = pthread_cond_init(&taxiarrive,NULL);
pthread_mutex_t menarrive = PTHREAD_MUTEX_INITIALIZER;
//int pmi = pthread_mutex_init(&menarrive,NULL);

int mencount = 0;

void* taxicome(void* name){
	cout<<"taxi: "<<(char*)name<<"arrived"< 0){
			pthread_cond_signal(&taxiarrive);
			pthread_mutex_unlock(&menarrive);}
		pthread_mutex_unlock(&menarrive);}
	pthread_exit((void*)0);}


void* mencome(void* name){
	cout<<(char*)name<<" come,need a taxi!"<

你可能感兴趣的:(./nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed)