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.
The returned object is not retained and autoreleased for performance reasons!
- Parameters:
-
| key | The Thread Local Storage key |
+ (void) setObject: |
|
(id) |
obj |
forTLSKey: |
|
(OFTLSKey*) |
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 |
+ (void) sleepForTimeInterval: |
|
(int64_t) |
sec |
|
|
Suspends execution of the current thread for the specified time interval.
- Parameters:
-
| sec | The number of seconds to sleep |
+ (void) sleepForTimeInterval: |
|
(int64_t) |
sec |
microseconds: |
|
(uint32_t) |
usec | |
|
|
| | |
Suspends execution of the current thread for the specified time interval.
- Parameters:
-
| sec | The number of seconds to sleep |
| usec | The number of microseconds to sleep |
+ (void) sleepUntilDate: |
|
(OFDate*) |
date |
|
|
Suspends execution of the current thread until the specified date.
Terminates the current thread, letting it return nil.
+ (void) terminateWithObject: |
|
(id) |
obj |
|
|
Terminates the current thread, letting it return the specified object.
- Parameters:
-
| obj | The object which the terminated thread will return |
- Returns:
- A new, autoreleased thread
+ (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: