9
when I try to make a map that has string as key and pthread_mutex_t as element,
map<string, pthread_mutex_t> connectedClientsMutexes;
pthread_mutex_t myMutex;//= PTHREAD_MUTEX_INITIALIZER;
connectedClientsMutexes.insert(pair<string,pthread_mutex_t>(userName,myMutex));
while (1)
{
pthread_mutex_lock(&connectedClientsMutexes[userName]);
// do something here
}
this generates:
phase3: pthread_mutex_lock.c:312: __pthread_mutex_lock_full: Assertion `(-(e)) != 3 || !robust' failed.