Hi,
su_clone_start(...)
{
......
struct clone_args arg = {
NULL, NULL, NULL,
PTHREAD_MUTEX_INITIALIZER,
PTHREAD_COND_INITIALIZER,
-1,
SU_MSG_R_INIT,
NULL
};
....
// +2 win32 handle
pthread_mutex_lock(&arg.mutex);
if (pthread_create(&tid, NULL, su_clone_main, &arg) == 0) {
pthread_cond_wait(&arg.cv, &arg.mutex);
thread_created = 1;
}
pthread_mutex_unlock(&arg.mutex);
.......
}
It's my fix
pthread_mutex_init(&arg.mutex);
pthread_cond_init(&arg.cv);
pthread_mutex_lock(&arg.mutex);
if (pthread_create(&tid, NULL, su_clone_main, &arg) == 0) {
pthread_cond_wait(&arg.cv, &arg.mutex);
thread_created = 1;
}
pthread_mutex_unlock(&arg.mutex);
pthread_mutex_destroy(&arg.mutex);
pthread_cond_destroy(&arg.cv);
Thanks
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel