diff options
author | Adam Langley <alangley@gmail.com> | 2015-05-16 02:00:15 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-20 22:18:44 +0300 |
commit | 552df47dc0c22d567e11e87204229d04a0fb7f2d (patch) | |
tree | a9fabef6c361268bbd84919121be80f22a116777 /crypto/thread.c | |
parent | 6fb174e564a839e9b3bdffaab5353c89ee1e826d (diff) |
Remove leftovers of the old-style locks.
At this point, none of these functions or macros are used so they can
just be deleted.
Change-Id: I8ed1aae7a252e886864bf43e3096eff2228183cd
Reviewed-on: https://boringssl-review.googlesource.com/4777
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/thread.c')
-rw-r--r-- | crypto/thread.c | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/crypto/thread.c b/crypto/thread.c index 954e2ae4..88371159 100644 --- a/crypto/thread.c +++ b/crypto/thread.c @@ -69,40 +69,16 @@ #include <openssl/mem.h> -#define CRYPTO_LOCK_ITEM(x) #x - -/* lock_names contains the names of all the locks defined in thread.h. */ -static const char *const lock_names[] = { - CRYPTO_LOCK_LIST -}; - -#undef CRYPTO_LOCK_ITEM - -#define CRYPTO_NUM_LOCKS (sizeof(lock_names) / sizeof(lock_names[0])) - -static void (*locking_callback)(int mode, int lock_num, const char *file, - int line) = 0; -static int (*add_lock_callback)(int *pointer, int amount, int lock_num, - const char *file, int line) = 0; - -int CRYPTO_num_locks(void) { return CRYPTO_NUM_LOCKS; } +int CRYPTO_num_locks(void) { return 1; } void CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, - const char *file, int line)) { - locking_callback = func; -} + const char *file, int line)) {} void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, - const char *file, int line)) { - add_lock_callback = func; -} + const char *file, int line)) {} const char *CRYPTO_get_lock_name(int lock_num) { - if (lock_num >= 0 && lock_num < CRYPTO_NUM_LOCKS) { - return lock_names[lock_num]; - } else { - return "ERROR"; - } + return "No old-style OpenSSL locks anymore"; } int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { return 1; } @@ -113,22 +89,6 @@ void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) {} void CRYPTO_THREADID_current(CRYPTO_THREADID *id) {} -void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, - const char *file, int line) { - return locking_callback; -} - -int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int lock_num, - const char *file, int line) { - return add_lock_callback; -} - -void CRYPTO_lock(int mode, int lock_num, const char *file, int line) { - if (locking_callback != NULL) { - locking_callback(mode, lock_num, file, line); - } -} - void CRYPTO_set_id_callback(unsigned long (*func)(void)) {} void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( |