Author: rfm
Date: Tue Jul 28 22:08:10 2015
New Revision: 38844
URL: http://svn.gna.org/viewcvs/gnustep?rev=38844&view=rev
Log:
add startup and shutdown methods
Modified:
libs/performance/trunk/GSIOThreadPool.h
libs/performance/trunk/GSIOThreadPool.m
Modified: libs/performance/trunk/GSIOThreadPool.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/performance/trunk/GSIOThreadPool.h?rev=38844&r1=38843&r2=38844&view=diff
==============================================================================
--- libs/performance/trunk/GSIOThreadPool.h (original)
+++ libs/performance/trunk/GSIOThreadPool.h Tue Jul 28 22:08:10 2015
@@ -47,6 +47,16 @@
* 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
Modified: libs/performance/trunk/GSIOThreadPool.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/performance/trunk/GSIOThreadPool.m?rev=38844&r1=38843&r2=38844&view=diff
==============================================================================
--- libs/performance/trunk/GSIOThreadPool.m (original)
+++ libs/performance/trunk/GSIOThreadPool.m Tue Jul 28 22:08:10 2015
@@ -62,6 +62,7 @@
- (void) _finish: (NSTimer*)t
{
_timer = nil;
+ [self shutdown];
[NSThread exit];
}
@@ -72,6 +73,7 @@
NSDate *when = [NSDate distantFuture];
NSTimeInterval delay = [when timeIntervalSinceNow];
+ [self startup];
_timer = [NSTimer scheduledTimerWithTimeInterval: delay
target: self
selector: @selector(_finish:)
@@ -103,6 +105,16 @@
return self;
}
#endif
+
+- (void) shutdown
+{
+ return;
+}
+
+- (void) startup
+{
+ return;
+}
/* End execution of the thread by the specified date.
*/
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs