static pthread_mutex_t gLock; //global
pthread_mutex_init(&gLock,NULL); //in init
pthread_mutex_lock(&gLock);
for(int i=0;i<[message count];i++)
CFSetAddValue(mSet, [message objectAtIndex:i]);
pthread_mutex_unlock(&gLock);
Мое приложение какао переходит в режим зависания с pthread_mutex_t.
@synchronized(mSet)
{
for(int i=0;i<[message count];i++)
CFSetAddValue(mSet, [message objectAtIndex:i]);
}
Мое приложение нормально работает с синхронизированным блоком.
Почему?