mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
32 lines
619 B
Objective-C
32 lines
619 B
Objective-C
#ifndef INCLUDED_GSTIMEOUTSOURCE_H
|
|
#define INCLUDED_GSTIMEOUTSOURCE_H
|
|
|
|
#import "common.h"
|
|
#import "GSDispatch.h"
|
|
|
|
/*
|
|
* A helper class that wraps a libdispatch timer.
|
|
*
|
|
* Used to implement the timeout of `GSMultiHandle` and `GSEasyHandle`
|
|
*/
|
|
@interface GSTimeoutSource : NSObject
|
|
{
|
|
dispatch_source_t _timer;
|
|
NSInteger _timeoutMs;
|
|
bool _isSuspended;
|
|
}
|
|
|
|
|
|
- (instancetype) initWithQueue: (dispatch_queue_t)queue
|
|
handler: (dispatch_block_t)handler;
|
|
|
|
- (NSInteger) timeout;
|
|
- (void) setTimeout: (NSInteger)timeoutMs;
|
|
|
|
- (void) suspend;
|
|
|
|
- (void) cancel;
|
|
|
|
@end
|
|
|
|
#endif
|