Lines Matching refs:mutex_buf
48 static MBEDTLS_MUTEX_T *mutex_buf = NULL; variable
54 mutex_buf = calloc(1, NUMT * sizeof(MBEDTLS_MUTEX_T)); in Curl_mbedtlsthreadlock_thread_setup()
55 if(!mutex_buf) in Curl_mbedtlsthreadlock_thread_setup()
60 if(pthread_mutex_init(&mutex_buf[i], NULL)) in Curl_mbedtlsthreadlock_thread_setup()
63 mutex_buf[i] = CreateMutex(0, FALSE, 0); in Curl_mbedtlsthreadlock_thread_setup()
64 if(mutex_buf[i] == 0) in Curl_mbedtlsthreadlock_thread_setup()
76 if(!mutex_buf) in Curl_mbedtlsthreadlock_thread_cleanup()
81 if(pthread_mutex_destroy(&mutex_buf[i])) in Curl_mbedtlsthreadlock_thread_cleanup()
84 if(!CloseHandle(mutex_buf[i])) in Curl_mbedtlsthreadlock_thread_cleanup()
88 free(mutex_buf); in Curl_mbedtlsthreadlock_thread_cleanup()
89 mutex_buf = NULL; in Curl_mbedtlsthreadlock_thread_cleanup()
98 if(pthread_mutex_lock(&mutex_buf[n])) { in Curl_mbedtlsthreadlock_lock_function()
104 if(WaitForSingleObject(mutex_buf[n], INFINITE) == WAIT_FAILED) { in Curl_mbedtlsthreadlock_lock_function()
118 if(pthread_mutex_unlock(&mutex_buf[n])) { in Curl_mbedtlsthreadlock_unlock_function()
124 if(!ReleaseMutex(mutex_buf[n])) { in Curl_mbedtlsthreadlock_unlock_function()