diff options
author | makdharma <makdharma@users.noreply.github.com> | 2016-08-26 09:37:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-26 09:37:23 -0700 |
commit | 528af97af253792993ac313de3a173ea894861ce (patch) | |
tree | 1a9518677239b91f55197f33c36d409fa682f21d | |
parent | 179e62467931c75a78a7528541760fa3e086e312 (diff) | |
parent | 7603d64982ea5de924218d600a851d6c8a4e6415 (diff) |
Merge pull request #7866 from jcanizales/p0-grpc-init-on-load
Let tracing be enabled before starting an RPC
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 5 | ||||
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index da9473f9a2..b5d8309787 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -103,6 +103,11 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; @synthesize state = _state; +// TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize. ++ (void)load { + grpc_init(); +} + - (instancetype)init { return [self initWithHost:nil path:nil requestsWriter:nil]; } diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 97f6b89340..1339429660 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -245,11 +245,6 @@ } if (self = [super init]) { - static dispatch_once_t initialization; - dispatch_once(&initialization, ^{ - grpc_init(); - }); - // Each completion queue consumes one thread. There's a trade to be made between creating and // consuming too many threads and having contention of multiple calls in a single completion // queue. Currently we use a singleton queue. |