forked from BB9z/RFKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RFDispatch.h
42 lines (31 loc) · 1.12 KB
/
RFDispatch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*!
RFDispatch
RFKit
GCD helper
Copyright (c) 2012-2014 BB9z
https://github.com/bb9z/RFKit
The MIT License (MIT)
http://www.opensource.org/licenses/mit-license.php
*/
#import "RFRuntime.h"
#ifdef __BLOCKS__
/** Short version for dispatch_after.
@warning The block will be executed on main thread.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW
void dispatch_after_seconds(NSTimeInterval delayInSeconds, dispatch_block_t block);
/**
Submits a block object for execution on the main queue and waits until that block completes.
You can call this function on the application’s main thread and won’t results in deadlock.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void dispatch_sync_on_main(dispatch_block_t block);
/**
Submits a block for asynchronous execution on the global background concurrent queue.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void dispatch_async_on_background(dispatch_block_t block);
#endif