CRYPTO_LOCK(3)
π CRYPTO_LOCK(3) π
Okay bestie, this is the Library Functions Manual page for CRYPTO_LOCK(3) β thread-support lore, but make it make sense. π§΅β¨
πΈ NAME πΈ
CRYPTO_lock, CRYPTO_w_lock, CRYPTO_w_unlock, CRYPTO_r_lock, CRYPTO_r_unlock, CRYPTO_add β thread support. That's the whole little squad, no cap.
β¨ SYNOPSIS β¨
#include <openssl/crypto.h>
void
CRYPTO_lock(int mode, int type, const char *file, int line);
int
CRYPTO_add(int *p, int amount, int type);
#define CRYPTO_w_lock(type) \
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__)
#define CRYPTO_w_unlock(type) \
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, __FILE__, __LINE__)
#define CRYPTO_r_lock(type) \
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__)
#define CRYPTO_r_unlock(type) \
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__)
π DESCRIPTION π
π¨ These functions are obsolete. Like, yes, we're still documenting them, but they are obsolete.
CRYPTO_lock() locks or unlocks a mutex lock. π
mode is a bitfield describing what should be done with the lock. For each call, either CRYPTO_LOCK or CRYPTO_UNLOCK must be included. In the LibreSSL implementation, CRYPTO_READ and CRYPTO_WRITE are ignored.
type is a number in the range 0 <= type < CRYPTO_NUM_LOCKS identifying a particular lock. Currently, the value of CRYPTO_NUM_LOCKS is 41.
The file and line arguments are ignored.
In the LibreSSL implementation, CRYPTO_lock() is a wrapper around pthread_mutex_lock(3) and pthread_mutex_unlock(3).
CRYPTO_add() locks the lock number type, adds amount to *p, and unlocks the lock number type again.
π RETURN VALUES π
CRYPTO_add() returns the new value of *p.
π¦ SEE ALSO π¦
crypto(3)β the related page, bestie.
β HISTORY β
CRYPTO_lock(),CRYPTO_w_lock(),CRYPTO_w_unlock(),CRYPTO_r_lock(), andCRYPTO_r_unlock()first appeared in SSLeay 0.6.0.CRYPTO_add()first appeared in SSLeay 0.6.2.- These functions have been available since OpenBSD 2.4.
Source/version: Debian; date: March 14, 2024; manual: CRYPTO_LOCK(3). Bye bestie, mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· OpenSSL
- Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms