These should be write-locks, not read-locks.
authorGeoff Thorpe <geoff@openssl.org>
Mon, 8 Sep 2003 15:47:55 +0000 (15:47 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Mon, 8 Sep 2003 15:47:55 +0000 (15:47 +0000)
ssl/ssl_sess.c

index b4fb90448f8183aa278d4f69f03d8d86dca831c7..5cf79d274a289ae807f56e0cbd390205bf95190c 100644 (file)
@@ -79,11 +79,11 @@ SSL_SESSION *SSL_get1_session(SSL *ssl)
        /* Need to lock this all up rather than just use CRYPTO_add so that
         * somebody doesn't free ssl->session between when we check it's
         * non-null and when we up the reference count. */
-       CRYPTO_r_lock(CRYPTO_LOCK_SSL_SESSION);
+       CRYPTO_w_lock(CRYPTO_LOCK_SSL_SESSION);
        sess = ssl->session;
        if(sess)
                sess->references++;
-       CRYPTO_r_unlock(CRYPTO_LOCK_SSL_SESSION);
+       CRYPTO_w_unlock(CRYPTO_LOCK_SSL_SESSION);
        return(sess);
        }