A class which provides portable threads. More...
#import <OFThread.h>
Public Member Functions | |
(id) | - initWithObject: |
(id) | - main |
(id) | - join |
Static Public Member Functions | |
(id) | + threadWithObject: |
(id) | + setObject:forTLSKey: |
(id) | + objectForTLSKey: |
Public Attributes | |
id | retval |
Protected Attributes | |
id | object |
of_thread_t | thread |
BOOL | running |
A class which provides portable threads.
To use it, you should create a new class derived from it and reimplement main.
obj | An object that is passed to the main method as a copy or nil |
- (id) join |
Joins a thread.
- (id) main |
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.
+ (id) objectForTLSKey: | (OFTLSKey*) | key |
Returns the object for the specified Thread Local Storage key.
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.
key | The Thread Local Storage key | |
obj | The object the Thread Local Storage key will be set to |
obj | An object that is passed to the main method as a copy or nil |