Permalink
Browse files

Make use of blocks responding to -invoke.

  • Loading branch information...
1 parent f095ad6 commit 07363f827b56b4105b0a4ffbefa3e37e1a5d1aea @mikeabdullah mikeabdullah committed Apr 16, 2012
Showing with 2 additions and 7 deletions.
  1. +2 −7 KSThreadProxy.m
View
@@ -150,21 +150,16 @@ - (id)ks_proxyOnThread:(NSThread *)thread waitUntilDone:(BOOL)waitUntilDone;
#ifdef NS_BLOCKS_AVAILABLE
@implementation NSThread (KSThreadProxy)
-- (void)ks_executeBlock:(void (^)())block;
-{
- block();
-}
-
- (void)ks_performBlock:(void (^)())block;
{
block = [block copy];
- [self performSelector:@selector(ks_executeBlock:) onThread:self withObject:block waitUntilDone:NO];
+ [block performSelector:@selector(invoke) onThread:self withObject:nil waitUntilDone:NO];
[block release];
}
- (void)ks_performBlockAndWait:(void (^)())block;
{
- [self performSelector:@selector(ks_executeBlock:) onThread:self withObject:block waitUntilDone:YES];
+ [block performSelector:@selector(invoke) onThread:self withObject:nil waitUntilDone:YES];
}
@end

0 comments on commit 07363f8

Please sign in to comment.