aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/utils
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-02-23 18:15:23 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-02-23 18:15:23 -0800
commit2198484458e887ec3c7c0e15497c81f52dba5619 (patch)
tree6e6a0b188c7ba8993a81b999d2dc94eb0eb74995 /src/objc/utils
parent2b03e94aac54808afb2ad838c449f0e2d058849b (diff)
Fixed #608: cancelled scheduled operations that are not run will not run in the future.
Diffstat (limited to 'src/objc/utils')
-rw-r--r--src/objc/utils/MCOOperation.h4
-rw-r--r--src/objc/utils/MCOOperation.mm1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/objc/utils/MCOOperation.h b/src/objc/utils/MCOOperation.h
index 263d4a46..f46536c9 100644
--- a/src/objc/utils/MCOOperation.h
+++ b/src/objc/utils/MCOOperation.h
@@ -17,6 +17,9 @@
/** Returns whether the operation is cancelled.*/
@property (readonly) BOOL isCancelled;
+/** Returns whether the operation should run even if it's cancelled.*/
+@property (nonatomic, assign) BOOL shouldRunWhenCancelled;
+
/** The queue this operation dispatches the callback on. Defaults to the main queue.
This property should be used only if there's performance issue creating or calling the callback
in the main thread. */
@@ -29,7 +32,6 @@
/** Cancel the operation.*/
- (void) cancel;
-
@end
#endif
diff --git a/src/objc/utils/MCOOperation.mm b/src/objc/utils/MCOOperation.mm
index 7502afae..cabb9a61 100644
--- a/src/objc/utils/MCOOperation.mm
+++ b/src/objc/utils/MCOOperation.mm
@@ -82,6 +82,7 @@ public:
}
MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setCallbackDispatchQueue, callbackDispatchQueue);
+MCO_OBJC_SYNTHESIZE_SCALAR(BOOL, bool, setShouldRunWhenCancelled, shouldRunWhenCancelled);
- (void) cancel
{