Fixed #67, updated #66

This commit is contained in:
Roman Truba 2014-05-28 14:54:19 +04:00
parent 3496ef2187
commit b99fa7c09e
1 changed files with 1 additions and 3 deletions

View File

@ -72,7 +72,7 @@
/// How much times request was loaded
@property (readwrite, assign) int attemptsUsed;
/// Semaphore for blocking current thread
@property (nonatomic, assign) dispatch_semaphore_t waitUntilDoneSemaphore;
@property (nonatomic, strong) dispatch_semaphore_t waitUntilDoneSemaphore;
/// This request response
@property (nonatomic, strong) VKResponse *response;
/// This request error
@ -252,12 +252,10 @@
if (!self.waitUntilDone) {
[[VKHTTPClient getClient] enqueueOperation:_executionOperation];
} else {
self.responseQueue = dispatch_get_current_queue();
[self setOperation:(VKHTTPOperation*)_executionOperation responseQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)];
self.waitUntilDoneSemaphore = dispatch_semaphore_create(0);
[[VKHTTPClient getClient] enqueueOperation:_executionOperation];
dispatch_semaphore_wait(self.waitUntilDoneSemaphore, DISPATCH_TIME_FOREVER);
dispatch_release(self.waitUntilDoneSemaphore);
[self finishRequest];
}
}