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
pull/1/merge
nnoble 10 years ago committed by Nicolas Noble
parent a7baac5280
commit 8a23a3d96a
  1. 8
      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;

Loading…
Cancel
Save