OFThread Class Reference
A class which provides portable threads.
More...
#import <OFThread.h>
List of all members.
Detailed Description
A class which provides portable threads.
To use it, you should create a new class derived from it and reimplement main.
Member Function Documentation
- Returns:
- The current thread or nil if we are in the main thread
- (void) handleTermination |
|
|
|
|
This routine is exectued when the thread's main method has finished executing or terminate has been called.
- (id) initWithObject: |
|
(id) |
obj |
|
|
- Parameters:
-
| obj | An object that is passed to the main method as a copy or nil |
- Returns:
- An initialized OFThread.
Joins a thread.
- Returns:
- The object returned by the main method of the thread.
The main routine of the thread. You need to reimplement this!
It can access the object passed to the threadWithObject or initWithObject method using the instance variable named object.
- Returns:
- The object the join method should return when called for this thread
Returns the object for the specified Thread Local Storage key.
- Parameters:
-
| key | The Thread Local Storage key |
Sets the Thread Local Storage for the specified key.
The specified object is first retained and then the object stored before is released. You can specify nil as object if you want the old object to be released and don't want any new object for the TLS key.
- Parameters:
-
| key | The Thread Local Storage key |
| obj | The object the Thread Local Storage key will be set to |
- Returns:
- The old object, autoreleased
+ (void) sleepForNMilliseconds: |
|
(unsigned int) |
msecs |
|
|
Suspends execution of the current thread for N milliseconds.
Terminates the current thread, letting it return nil.
+ (void) terminateWithObject: |
|
(id) |
obj |
|
|
Terminates the current thread, letting it return the specified object.
- Parameters:
-
| The | object which the terminated thread will return |
+ (id) threadWithObject: |
|
(id) |
obj |
|
|
- Parameters:
-
| obj | An object that is passed to the main method as a copy or nil |
- Returns:
- A new autoreleased thread
Yields a processor voluntarily and moves the thread at the end of the queue for its priority.
The documentation for this class was generated from the following files: