Skip to content
Snippets Groups Projects
Commit c5dd4d47 authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Use a singleton completion queue

parent db3bccad
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,12 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
@implementation GRPCCompletionQueue
+ (instancetype)completionQueue {
return [[self alloc] init];
static GRPCCompletionQueue *singleton = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
singleton = [[self alloc] init];
});
return singleton;
}
- (instancetype)init {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment