sensitivity.io for iOS & macOS
1.1.4
|
#import <ThreadPool.h>
Instance Methods | |
(BOOL) | - setMaxThreadCount:withError: |
(BOOL) | - maxThreadCount:withError: |
(BOOL) | - timedWait:forDone:withError: |
(BOOL) | - waitForDoneWithError: |
(BOOL) | - activeThreadCount:withError: |
(BOOL) | - setExpiryTimeout:withError: |
(BOOL) | - expiryTimeout:withError: |
The thread pool where all module task executor threads exist.
- (BOOL) activeThreadCount: | (NSUInteger *_Nonnull) | activeThreadCount | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Get the number of active threads in the thread pool.
activeThreadCount | Will be set to the number of active threads in the threadpool |
error | The error representing the reason for the failure |
- (BOOL) expiryTimeout: | (NSInteger *_Nonnull) | expiryTimeout | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Gets the expiry timeout
expiryTimeout | Will be set to the existing expiry timeout |
error | The error representing the reason for the failure |
- (BOOL) maxThreadCount: | (NSUInteger *_Nonnull) | maxThreadCount | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Gets maximum number of threads used by the thread pool
maxThreadCount | Will be set to the maximum number of threads used by the thread pool |
error | The error representing the reason for the failure |
- (BOOL) setExpiryTimeout: | (NSInteger) | expiryTimeout | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Threads that are unused for expiryTimeout milliseconds are considered to have expired and will exit. Such threads will be restarted as needed. The default expiryTimeout is 30000 milliseconds. If expiryTimeout is negative, newly created threads will not expire (they will not exit until the thread pool is destroyed).
expiryTimeout | The expiryTimeout to set |
error | The error representing the reason for the failure |
- (BOOL) setMaxThreadCount: | (NSUInteger) | maxThreadCount | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Set maximum number of threads used by the thread pool.
maxThreadCount | maximum number of threads |
error | The error representing the reason for the failure |
- (BOOL) timedWait: | (NSUInteger) | msecs | |
forDone: | (BOOL *_Nonnull) | done | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Waits up to msecs milliseconds for all threads to exit and removes all threads from the thread pool.
msecs | The milliseconds to wait for all threads to be finished |
done | Will be set to true if threadpool is finished, false otherwise |
error | The error representing the reason for the failure |
- (BOOL) waitForDoneWithError: | (NSError *_Nullable *_Nullable) | error |
Waits untill all threads exit and are removed from the thread pool.
error | The error representing the reason for the failure |