Lines Matching refs:mutex_buf
48 static POLARSSL_MUTEX_T *mutex_buf = NULL;
55 mutex_buf = malloc(NUMT * sizeof(POLARSSL_MUTEX_T));
56 if(!mutex_buf)
61 ret = pthread_mutex_init(&mutex_buf[i], NULL);
67 mutex_buf[i] = CreateMutex(0, FALSE, 0);
68 if(mutex_buf[i] == 0)
81 if(!mutex_buf)
86 ret = pthread_mutex_destroy(&mutex_buf[i]);
92 ret = CloseHandle(mutex_buf[i]);
97 free(mutex_buf);
98 mutex_buf = NULL;
108 ret = pthread_mutex_lock(&mutex_buf[n]);
117 ret = (WaitForSingleObject(mutex_buf[n], INFINITE)==WAIT_FAILED?1:0);
133 ret = pthread_mutex_unlock(&mutex_buf[n]);
142 ret = ReleaseMutex(mutex_buf[n]);