Compile fix on platforms with missing pthread_rwlock_t.
authorDmitry Kostjuchenko <dmitrykos@neutroncode.com>
Tue, 22 Nov 2016 16:37:43 +0000 (18:37 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 3 Feb 2017 12:48:44 +0000 (13:48 +0100)
commit2accf3f7e013c3d02312afc27cc2edbd1f149db3
tree50eba019a8723d834b736c19d3ad6cc566b2c819
parent66bee01c822c5dd26679cad076c52b3d81199668
Compile fix on platforms with missing pthread_rwlock_t.

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/threads_pthread.c