Remove |CRYPTO_add|.
It's no longer needed after the conversion to |CRYPTO_refcount_t|.
Change-Id: Ied129c4c247fcd426745fa016350528b7571aaaa
Reviewed-on: https://boringssl-review.googlesource.com/4774
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/thread.c b/crypto/thread.c
index abc8b6f..954e2ae 100644
--- a/crypto/thread.c
+++ b/crypto/thread.c
@@ -129,22 +129,6 @@
}
}
-int CRYPTO_add_lock(int *pointer, int amount, int lock_num, const char *file,
- int line) {
- int ret = 0;
-
- if (add_lock_callback != NULL) {
- ret = add_lock_callback(pointer, amount, lock_num, file, line);
- } else {
- CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, lock_num, file, line);
- ret = *pointer + amount;
- *pointer = ret;
- CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, lock_num, file, line);
- }
-
- return ret;
-}
-
void CRYPTO_set_id_callback(unsigned long (*func)(void)) {}
void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(
diff --git a/include/openssl/thread.h b/include/openssl/thread.h
index 01df6ea..d5e05b7 100644
--- a/include/openssl/thread.h
+++ b/include/openssl/thread.h
@@ -181,12 +181,6 @@
OPENSSL_EXPORT void CRYPTO_lock(int mode, int lock_num, const char *file,
int line);
-/* CRYPTO_add_lock adds |amount| to |*pointer|, protected by the lock specified
- * by |lock_num|. It returns the new value of |*pointer|. Don't call this
- * function directly, rather use the |CRYPTO_add| macro. */
-OPENSSL_EXPORT int CRYPTO_add_lock(int *pointer, int amount, int lock_num,
- const char *file, int line);
-
/* Lock IDs start from 1. CRYPTO_LOCK_INVALID_LOCK is an unused placeholder
* used to ensure no lock has ID 0. */
#define CRYPTO_LOCK_LIST \
@@ -234,8 +228,6 @@
CRYPTO_lock(CRYPTO_LOCK | CRYPTO_READ, lock_num, __FILE__, __LINE__)
#define CRYPTO_r_unlock(lock_num) \
CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_READ, lock_num, __FILE__, __LINE__)
-#define CRYPTO_add(addr, amount, lock_num) \
- CRYPTO_add_lock(addr, amount, lock_num, __FILE__, __LINE__)
/* Private functions.