You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/Signal/src/util/Operation.h

34 lines
684 B
C

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
11 years ago
#import <Foundation/Foundation.h>
#import "StringUtil.h"
11 years ago
typedef void (^Action)(void);
typedef id (^Function)(void);
11 years ago
@interface Operation : NSObject
@property (nonatomic, readonly, copy) Action callback;
11 years ago
+ (Operation *)operation:(Action)block;
11 years ago
+ (void)asyncRun:(Action)action onThread:(NSThread *)thread;
11 years ago
+ (void)asyncRunAndWaitUntilDone:(Action)action onThread:(NSThread *)thread;
11 years ago
+ (void)asyncRunOnNewThread:(Action)action;
11 years ago
- (void)run;
11 years ago
- (SEL)selectorToRun;
11 years ago
- (void)performOnNewThread;
11 years ago
- (void)performOnThread:(NSThread *)thread;
11 years ago
- (void)performOnThreadAndWaitUntilDone:(NSThread *)thread;
11 years ago
@end