summaryrefslogtreecommitdiffstats
path: root/crypto/threads_win.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-09-25 12:04:42 +1000
committerPauli <paul.dale@oracle.com>2017-10-10 08:45:52 +1000
commit94683b7acb62a5d99b8b4d66283e6d6dd0007f7a (patch)
tree10cec2abdb2f43af401d65c1060c083bb0865fdf /crypto/threads_win.c
parent338ead0ff9b22aecbc3b28e37ea05d142e13ee13 (diff)
Add a CRYPTO_atomic_read call which allows an int variable to be read
in an atomic fashion. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4414)
Diffstat (limited to 'crypto/threads_win.c')
-rw-r--r--crypto/threads_win.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index 512e19f5f3..6f9c7b1bd3 100644
--- a/crypto/threads_win.c
+++ b/crypto/threads_win.c
@@ -133,6 +133,12 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
return 1;
}
+int CRYPTO_atomic_read(int *val, int *ret, CRYPTO_RWLOCK *lock)
+{
+ InterlockedCompareExchange(val, 0, 0);
+ return 1;
+}
+
int openssl_init_fork_handlers(void)
{
return 0;