Lines Matching refs:thread

47 int ossl_crypto_thread_native_join(CRYPTO_THREAD *thread, CRYPTO_THREAD_RETVAL *retval)  in ossl_crypto_thread_native_join()  argument
51 if (thread == NULL) in ossl_crypto_thread_native_join()
54 ossl_crypto_mutex_lock(thread->statelock); in ossl_crypto_thread_native_join()
56 while (!CRYPTO_THREAD_GET_STATE(thread, req_state_mask)) in ossl_crypto_thread_native_join()
57 ossl_crypto_condvar_wait(thread->condvar, thread->statelock); in ossl_crypto_thread_native_join()
59 if (CRYPTO_THREAD_GET_STATE(thread, CRYPTO_THREAD_JOINED)) in ossl_crypto_thread_native_join()
63 while (CRYPTO_THREAD_GET_STATE(thread, CRYPTO_THREAD_JOIN_AWAIT)) { in ossl_crypto_thread_native_join()
64 if (!CRYPTO_THREAD_GET_STATE(thread, CRYPTO_THREAD_JOINED)) in ossl_crypto_thread_native_join()
65 ossl_crypto_condvar_wait(thread->condvar, thread->statelock); in ossl_crypto_thread_native_join()
66 if (CRYPTO_THREAD_GET_STATE(thread, CRYPTO_THREAD_JOINED)) in ossl_crypto_thread_native_join()
69 CRYPTO_THREAD_SET_STATE(thread, CRYPTO_THREAD_JOIN_AWAIT); in ossl_crypto_thread_native_join()
70 ossl_crypto_mutex_unlock(thread->statelock); in ossl_crypto_thread_native_join()
72 if (ossl_crypto_thread_native_perform_join(thread, retval) == 0) in ossl_crypto_thread_native_join()
75 ossl_crypto_mutex_lock(thread->statelock); in ossl_crypto_thread_native_join()
77 CRYPTO_THREAD_UNSET_ERROR(thread, CRYPTO_THREAD_JOINED); in ossl_crypto_thread_native_join()
78 CRYPTO_THREAD_SET_STATE(thread, CRYPTO_THREAD_JOINED); in ossl_crypto_thread_native_join()
86 ossl_crypto_condvar_signal(thread->condvar); in ossl_crypto_thread_native_join()
87 ossl_crypto_mutex_unlock(thread->statelock); in ossl_crypto_thread_native_join()
90 *retval = thread->retval; in ossl_crypto_thread_native_join()
94 ossl_crypto_mutex_lock(thread->statelock); in ossl_crypto_thread_native_join()
95 CRYPTO_THREAD_SET_ERROR(thread, CRYPTO_THREAD_JOINED); in ossl_crypto_thread_native_join()
99 CRYPTO_THREAD_UNSET_STATE(thread, CRYPTO_THREAD_JOIN_AWAIT); in ossl_crypto_thread_native_join()
100 ossl_crypto_condvar_signal(thread->condvar); in ossl_crypto_thread_native_join()
102 ossl_crypto_mutex_unlock(thread->statelock); in ossl_crypto_thread_native_join()