aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
Commit message (Collapse)AuthorAgeFilesLines
* Grouped data declarations [skip ci]Dmitry Kostjuchenko2017-02-031-1/+0
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981)
* Removed tab spaces.Dmitry Kostjuchenko2017-02-031-2/+2
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1981)
* Corrections according the review comments.Dmitry Kostjuchenko2017-02-031-21/+22
| | | | | | 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)
* Compile fix on platforms with missing pthread_rwlock_t.Dmitry Kostjuchenko2017-02-031-0/+41
| | | | | | | | | | 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)
* CRYPTO_atomic_add(): check that the object is lock freeRichard Levitte2016-08-241-3/+5
| | | | | | If not, fall back to our own code, using the given mutex Reviewed-by: Andy Polyakov <appro@openssl.org>
* CRYPTO_atomic_add(): use acquire release memory order rather than relaxedRichard Levitte2016-08-241-2/+2
| | | | | | | | 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>
* Check for __GNUC__ to use GNU C atomic buildinsRichard Levitte2016-08-241-3/+3
| | | | | | | | | Note: we trust any other compiler that fully implements GNU extension to define __GNUC__ RT#4642 Reviewed-by: Andy Polyakov <appro@openssl.org>
* Copyright consolidation 09/10Rich Salz2016-05-171-46/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fold threads.h into crypto.h making API publicViktor Dukhovni2016-05-161-1/+0
| | | | | | Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
* GH773: Possible leak on CRYPTO_THREAD_lock_new failureFdaSilvaYY2016-03-031-1/+3
| | | | | Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Matt Caswell <matt@openssl.org>
* Implement new multi-threading APIAlessandro Ghedini2016-02-261-0/+167
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>