Lines Matching refs:lock
18 int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
19 int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
20 int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock);
21 void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock);
23 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
25 CRYPTO_RWLOCK *lock);
26 int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock);
55 lock.
59 CRYPTO_THREAD_read_lock() locks the provided I<lock> for reading.
63 CRYPTO_THREAD_write_lock() locks the provided I<lock> for writing.
67 CRYPTO_THREAD_unlock() unlocks the previously locked I<lock>.
71 CRYPTO_THREAD_lock_free() frees the provided I<lock>.
76 result of the operation in I<*ret>. I<lock> will be locked, unless atomic
80 supported and I<lock> is NULL, then the function will fail.
86 I<*ret>. I<lock> will be locked, unless atomic operations are supported on the
90 supported and I<lock> is NULL, then the function will fail.
95 I<lock> will be locked, unless atomic operations are supported on the specific
98 the variable is read. If atomic operations are not supported and I<lock> is
107 CRYPTO_THREAD_lock_new() returns the allocated lock, or NULL on error.
135 This example safely initializes and uses a lock.
143 static CRYPTO_RWLOCK *lock;
147 lock = CRYPTO_THREAD_lock_new();
152 if (!CRYPTO_THREAD_run_once(&once, void init) || lock == NULL)
154 return CRYPTO_THREAD_write_lock(lock);
159 return CRYPTO_THREAD_unlock(lock);
167 /* Your code here, do not return without releasing the lock! */
177 The simplest solution is to just "leak" the lock in applications and not