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