mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
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:
parent
d09edf1fff
commit
e50bb2e496
3 changed files with 23 additions and 0 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue