summaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
AgeCommit message (Collapse)Author
2017-02-03Grouped data declarations [skip ci]Dmitry Kostjuchenko
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981) (cherry picked from commit bc1dba209533f2033a4de0d93380fc0f485e6f7e)
2017-02-03Removed tab spaces.Dmitry Kostjuchenko
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981) (cherry picked from commit 5d5eed4456ebc035893eedbcc4e32a9d065cecb3)
2017-02-03Corrections according the review comments.Dmitry Kostjuchenko
Updated indentations according project rules, renamed file-local define to the shorter version - USE_RWLOCK, fixed declaration after the if statement in CRYPTO_THREAD_lock_new(). Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981) (cherry picked from commit ec93a2921f6128ac931466ae171fba92a0eab45d)
2017-02-03Compile fix on platforms with missing pthread_rwlock_t.Dmitry Kostjuchenko
Fix compilation on platforms with missing pthread_rwlock_t implementation by replacing it with pthread_mutex_t. An example of such platform can be Android OS 2.0 - 2.1, API level 5 (Eclair), Android NDK platform - android-5 where pthread_rwlock_t is not implemented and is missing in pthread.h. In case of missing pthread_rwlock_t implementation CRYPTO_RWLOCK will work as exclusive lock in write-only mode of pthread_rwlock_t lock. The implementation based on pthread_mutex_t must be using PTHREAD_MUTEX_RECURSIVE mode to be compatible with recursive behavior of pthread_rwlock_rdlock. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981) (cherry picked from commit 2accf3f7e013c3d02312afc27cc2edbd1f149db3)
2016-08-24CRYPTO_atomic_add(): check that the object is lock freeRichard Levitte
If not, fall back to our own code, using the given mutex Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-08-24CRYPTO_atomic_add(): use acquire release memory order rather than relaxedRichard Levitte
For increments, the relaxed model is fine. For decrements, it's recommended to use the acquire release model. We therefore go for the latter. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-08-24Check for __GNUC__ to use GNU C atomic buildinsRichard Levitte
Note: we trust any other compiler that fully implements GNU extension to define __GNUC__ RT#4642 Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-05-17Copyright consolidation 09/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-16Fold threads.h into crypto.h making API publicViktor Dukhovni
Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-03GH773: Possible leak on CRYPTO_THREAD_lock_new failureFdaSilvaYY
Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-26Implement new multi-threading APIAlessandro Ghedini
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>