// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
ret = pthread_mutex_lock(&_singletonMutex); // acquire lock to be alone
if (_singleton == 0) // another thread may have got
{ // the lock after the first test
- _singleton = new LocalTraceCollector();
+ BaseTraceCollector* myInstance = new LocalTraceCollector();
sem_init(&_sem,0,0); // to wait until run thread is initialized
pthread_t traceThread;
- int bid;
int re2 = pthread_create(&traceThread, NULL,
- LocalTraceCollector::run, (void *)bid);
+ LocalTraceCollector::run, NULL);
sem_wait(&_sem);
+ _singleton = myInstance; // _singleton known only when init done
}
ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
_threadToClose = 0;
}
_singleton = 0;
- ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
+ ret = pthread_mutex_unlock(&_singletonMutex); // release lock
}
// ============================================================================