mirror of
https://github.com/gnustep/libs-performance.git
synced 2025-02-15 16:11:14 +00:00
add startup and shutdown methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@38844 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d2d36aaa35
commit
e2d66ee254
2 changed files with 22 additions and 0 deletions
|
@ -47,6 +47,16 @@ typedef unsigned int NSUInteger;
|
|||
* the date is nil or is in the past).
|
||||
*/
|
||||
- (void) terminate: (NSDate*)when;
|
||||
|
||||
/** Called when the thread is shut down (immediately before exit).<br />
|
||||
* Does nothing, provided for subclasses to override.
|
||||
*/
|
||||
- (void) shutdown;
|
||||
|
||||
/** Called when the thread is started up (before the run loop starts).<br />
|
||||
* Does nothing, provided for subclasses to override.
|
||||
*/
|
||||
- (void) startup;
|
||||
@end
|
||||
|
||||
/** This class provides a thread pool for performing methods which need to
|
||||
|
|
|
@ -62,6 +62,7 @@ static NSRecursiveLock *classLock = nil;
|
|||
- (void) _finish: (NSTimer*)t
|
||||
{
|
||||
_timer = nil;
|
||||
[self shutdown];
|
||||
[NSThread exit];
|
||||
}
|
||||
|
||||
|
@ -72,6 +73,7 @@ static NSRecursiveLock *classLock = nil;
|
|||
NSDate *when = [NSDate distantFuture];
|
||||
NSTimeInterval delay = [when timeIntervalSinceNow];
|
||||
|
||||
[self startup];
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval: delay
|
||||
target: self
|
||||
selector: @selector(_finish:)
|
||||
|
@ -104,6 +106,16 @@ static NSRecursiveLock *classLock = nil;
|
|||
}
|
||||
#endif
|
||||
|
||||
- (void) shutdown
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
- (void) startup
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* End execution of the thread by the specified date.
|
||||
*/
|
||||
- (void) terminate: (NSDate*)when
|
||||
|
|
Loading…
Reference in a new issue