added OSX convenience method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36966 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-08-12 08:56:18 +00:00
parent d09edf1fff
commit e50bb2e496
3 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2013-08-12 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSThread.h:
* Source/NSThread.m:
Added ([-performSelectorInBackground:withObject:]) convenience method
from OSX 10.5
2013-08-10 Ivan Vucica <ivan@vucica.net>
* Source/NSPathUtilities.m:

View file

@ -315,6 +315,13 @@ extern "C" {
onThread: (NSThread*)aThread
withObject: (id)anObject
waitUntilDone: (BOOL)aFlag;
/**
* Creates and runs a new background thread sending aSelector to the receiver
* and passing anObject (which may be nil) as the argument.
*/
- (void) performSelectorInBackground: (SEL)aSelector
withObject: (id)anObject;
#endif
@end

View file

@ -1303,6 +1303,15 @@ GSRunLoopInfoForThread(NSThread *aThread)
waitUntilDone: aFlag
modes: commonModes()];
}
- (void) performSelectorInBackground: (SEL)aSelector
withObject: (id)anObject
{
[NSThread detachNewThreadSelector: aSelector
toTarget: self
withObject: anObject];
}
@end
/**