@@ -61,11 +61,11 @@ id retval; #endif } /** - * \param obj An object that is passed to the main method as a copy + * \param obj An object that is passed to the main method as a copy or nil * \return A new, autoreleased thread */ + threadWithObject: (id)obj; /** @@ -87,11 +87,11 @@ * \param key The Thread Local Storage key */ + (id)objectForTLSKey: (OFTLSKey*)key; /** - * \param obj An object that is passed to the main method as a copy + * \param obj An object that is passed to the main method as a copy or nil * \return An initialized OFThread. */ - initWithObject: (id)obj; /** @@ -109,5 +109,33 @@ * * \return The object returned by the main method of the thread. */ - join; @end + +/** + * A class for creating mutual exclusions. + */ +@interface OFMutex: OFObject +{ +#ifndef _WIN32 + pthread_mutex_t mutex; +#else + HANDLE mutex; +#endif +} + +/** + * \return A new, autoreleased mutex. + */ ++ mutex; + +/** + * Locks the mutex. + */ +- lock; + +/** + * Unlocks the mutex. + */ +- unlock; +@end