mitsuba-af602c6fd98a/src/libcore/tls.cpp
/// A new thread was started -- set up TLS data structures
A new thread was started -- set up TLS data structures
A new thread was started -- set up TLS data structures
void initializeLocalTLS() {
	boost::lock_guard<boost::mutex> guard(ptdGlobalLock);
#if defined(__OSX__)
	PerThreadData *ptd = (PerThreadData *) pthread_getspecific(ptdLocal);
	if (!ptd) {
		ptd = new PerThreadData();
		ptdGlobal.insert(ptd);
		pthread_setspecific(ptdLocal, ptd);
	}
#else
	if (!ptdLocal) {
		ptdLocal = new PerThreadData();
		ptdGlobal.insert(ptdLocal);
	}
#endif
}
void initializeLocalTLS ( ) { boost :: lock_guard < boost :: mutex > guard ( ptdGlobalLock ) ; #if defined ( __OSX__ ) PerThreadData * ptd = ( PerThreadData * ) pthread_getspecific ( ptdLocal ) ; if ( ! ptd ) { ptd = new PerThreadData ( ) ; ptdGlobal . insert ( ptd ) ; pthread_setspecific ( ptdLocal , ptd ) ; } #else if ( ! ptdLocal ) { ptdLocal = new PerThreadData ( ) ; ptdGlobal . insert ( ptdLocal ) ; } #endif }
A new thread was started -- set up TLS data structures
A new thread was started -- set up TLS data structures