scottc@net-community.com
)mccallum@gnu.ai.mit.edu
)richard@brainstorm.co.uk
)n.pero@mi.flashnet.it
)Version: 1.78
Date: 2004/03/12 16:51:30
Copyright: (C) 1996-2000 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSThread.h
Standards:
- MacOS-X
- OpenStep
- GNUstep
This class encapsulates OpenStep threading. See
NSLock
and its subclasses for handling synchronisation between
threads.
Each process begins with a main
thread and additional threads can be created using
NSThread. The GNUstep implementation of OpenStep
has been carefully designed so that the internals of
the base library do not use threading (except for
methods which explicitly deal with threads of
course) so that you can write applications without
threading. Non-threaded applications re more
efficient (no locking is required) and are easier
to debug during development.
Description forthcoming.
Description forthcoming.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Description forthcoming.
Description forthcoming.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Returns the NSThread object corresponding to the current thread.
NB. In GNUstep the library internals use the GSCurrentThread() function as a more efficient mechanism for doing this job - so you cannot use a category to override this method and expect the library internals to use your implementation.
Create a new thread - use this method rather than alloc-init
Terminating a thread What happens if the thread doesn't call +exit - it doesn't terminate!
Returns a flag to say whether the application is multi-threaded or not. An application is considered to be multi-threaded if any thread other than the main thread has been started, irrespective of whether that thread has since terminated.
Set the priority of the current thread. This is a value in the range 0.0 (lowest) to 1.0 (highest) which is mapped to the underlying system priorities. The current gnu objc runtime supports three priority levels which you can obtain using values of 0.0, 0.5, and 1.0
Delaying a thread... pause until the specified date.
Return the priority of the current thread.
Return the thread dictionary. This dictionary can be
used to store arbitrary thread specific data.
NB. This cannot be autoreleased, since we cannot be
sure that the autorelease pool for the thread will
continue to exist for the entire life of the
thread!
- Declared in:
- Foundation/NSThread.h
Standards:
- MacOS-X
- NotOpenStep
- GNUstep
Extra methods to permit messages to be sent to an
object such that they are executed in the
main thread.
The main thread is the
thread in which the GNUstep system is started, and
where the GNUstep gui is used, it is the thread in
which gui drawing operations must be
performed.
Invokes
-performSelectorOnMainThread:withObject:waitUntilDone:modes:
using the supplied arguments and an array containing common modes.
These modes consist of NSRunLoopMode, NSConnectionreplyMode, and if in an application, the NSApplication modes.
This method performs aSelector on the receiver, passing anObject as an argument, but does so in the main thread of the program. The receiver and anObject are both retained until the method is performed.
The selector is performed when the runloop of the
main thread next runs in one of the modes specified
in anArray.
Where this method has
been called more than once before the runloop of the
main thread runs in the required mode, the order in
which the operations in the main thread is done is
the same as that in which they were added using this
method.
If there are no modes in anArray, the method has no effect and simply returns immediately.
The argument aFlag specifies whether the
method should wait until the selector has been
performed before returning.
NB. This method does
not cause the runloop of the main thread to
be run... so if the runloop is not executed by some
code in the main thread, the thread waiting for the
perform to complete will block forever.
As a special case, if aFlag ==
YES
and the current thread is the
main thread, the modes array is ignored and the
selector is performed immediately. This behavior
is necessary to avoid the main thread being blocked by
waiting for a perform which will never happen
because the runloop is not executing.