summaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
AgeCommit message (Collapse)Author
2018-08-17crypto/threads_*: remove CRYPTO_atomic_{read|write}.Andy Polyakov
CRYPTO_atomic_read was added with intention to read statistics counters, but readings are effectively indistinguishable from regular load (even in non-lock-free case). This is because you can get out-dated value in both cases. CRYPTO_atomic_write was added for symmetry and was never used. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/6883)
2018-04-17Update copyright yearRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5990)
2018-04-05Set error code if alloc returns NULLRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5886)
2017-10-11Return a value from atomic read on Windows.Pauli
Use a read lock when reading using pthreads. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4517)
2017-10-10Add atomic write callPauli
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4414)
2017-10-10Add a CRYPTO_atomic_read call which allows an int variable to be readPauli
in an atomic fashion. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4414)
2017-08-18Put thread-fork-init inside a run-once guardRich Salz
Thanks to Christian Heimes for pointing this out. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4191)
2017-08-06Add missing include of cryptlib.hRich Salz
Also use "" not <> for all include cryptlib Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4082)
2017-06-29Add fork handlers, based on pthread_atforkRich Salz
Only for Unix platforms Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3754)
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)
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)
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)
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)
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>