OFThread Class Reference

#import <OFThread.h>

Inheritance diagram for OFThread:
OFObject

List of all members.

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

Detailed Description

The OFThread class provides portable threads.

To use it, you should create a new class derived from it and reimplement main.


Member Function Documentation

- (id) initWithObject: (OFObject <OFCopying>*)  obj  
Parameters:
obj An object that is passed to the main method as a copy or nil
Returns:
An initialized OFThread.
- (id) join  

Joins a thread.

Returns:
The object returned by the main method of the 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.

Returns:
The object the join method should return when called for this thread
+ (id) objectForTLSKey: (OFTLSKey*)  key  

Returns the object for the specified Thread Local Storage key.

Parameters:
key The Thread Local Storage key
+ (id) setObject: (OFObject*)  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
+ (id) threadWithObject: (OFObject <OFCopying>*)  obj  
Parameters:
obj An object that is passed to the main method as a copy or nil
Returns:
A new autoreleased thread

The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on Mon Feb 1 19:19:40 2010 for ObjFW by  doxygen 1.6.1