diff options
author | nnoble <nnoble@google.com> | 2014-12-16 10:10:29 -0800 |
---|---|---|
committer | Nicolas Noble <nnoble@google.com> | 2014-12-16 17:11:03 -0800 |
commit | 8a23a3d96a13e6c748d29fa2126c70fb9c3b5b5f (patch) | |
tree | 17ad3527112dcf88cae2ea1eefb5aaa3ba9b67fe | |
parent | a7baac5280e8b368a889cfe2e7ee5b6091c14c3c (diff) |
Replacing pthread_once by gpr_once, in the opensource conversion.
Change on 2014/12/16 by nnoble <nnoble@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82243767
-rw-r--r-- | src/core/tsi/ssl_transport_security.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index 2c74b3635a..b9e48e7373 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -34,9 +34,9 @@ #include "src/core/tsi/ssl_transport_security.h" #include <limits.h> -#include <pthread.h> #include <grpc/support/log.h> +#include <grpc/support/sync.h> #include "src/core/tsi/transport_security.h" #include <openssl/bio.h> @@ -103,7 +103,7 @@ typedef struct { /* --- Library Initialization. ---*/ -static pthread_once_t init_openssl_once = PTHREAD_ONCE_INIT; +static gpr_once init_openssl_once = GPR_ONCE_INIT; static void init_openssl(void) { SSL_library_init(); @@ -1109,7 +1109,7 @@ tsi_result tsi_create_ssl_client_handshaker_factory( tsi_ssl_client_handshaker_factory* impl = NULL; tsi_result result = TSI_OK; - pthread_once(&init_openssl_once, init_openssl); + gpr_once_init(&init_openssl_once, init_openssl); if (factory == NULL) return TSI_INVALID_ARGUMENT; *factory = NULL; @@ -1188,7 +1188,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory( tsi_result result = TSI_OK; uint32_t i = 0; - pthread_once(&init_openssl_once, init_openssl); + gpr_once_init(&init_openssl_once, init_openssl); if (factory == NULL) return TSI_INVALID_ARGUMENT; *factory = NULL; |