Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined [message #15917] Thu, 15 May 2008 23:48 Go to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
I tried to compile with MT flag under FreeBSD and got the above mentioned definition error.

Would it be an alternative to set the recursive flag within Mutex constructor like this:
static pthread_mutex_t sMutexInit = NULL;//PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;

Mutex::Mutex()
{
	pthread_mutexattr_init(&mutex_attr);
	pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
	pthread_mutex_init(&sMutexInit, &mutex_attr);
	*mutex = sMutexInit;
}

?

Do you have a reasonable example I can test with?

Matthias
Re: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP not defined [message #15928 is a reply to message #15917] Sat, 17 May 2008 00:27 Go to previous message
mirek is currently offline  mirek
Messages: 11701
Registered: November 2005
Ultimate Member
Yes, I believe this an OK alternative.

I will try in Linux tomorrow, I guess it can be the default code to save the trouble.

Mirek
Previous Topic: MT/Locking Questions
Next Topic: Interprocess communication with U++
Goto Forum:
  


Current Time: Tue Feb 19 09:27:15 CET 2019

Total time taken to generate the page: 0.00680 seconds