@@ -66,25 +66,31 @@ OF_THREAD_RUNNING, OF_THREAD_WAITING_FOR_JOIN } _running; void *_pool; # ifdef OF_HAVE_BLOCKS - of_thread_block_t _threadBlock; + of_thread_block_t _Nullable _threadBlock; # endif id _returnValue; - OFRunLoop *_runLoop; + OFRunLoop *_Nullable _runLoop; OFMutableDictionary *_threadDictionary; @private - OFString *_name; + OFString *_Nullable _name; } -#ifdef OF_HAVE_BLOCKS +/*! + * The name for the thread to use when starting it. + */ +@property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *name; + +# ifdef OF_HAVE_BLOCKS /*! * The block to execute in the thread. */ -@property (readonly, nonatomic) of_thread_block_t threadBlock; -#endif +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) + of_thread_block_t threadBlock; +# endif /*! * @brief Creates a new thread. * * @return A new, autoreleased thread @@ -104,26 +110,26 @@ /*! * @brief Returns the current thread. * * @return The current thread */ -+ (OFThread *)currentThread; ++ (nullable OFThread *)currentThread; /*! * @brief Returns the main thread. * * @return The main thread */ -+ (OFThread *)mainThread; ++ (nullable OFThread *)mainThread; /*! * @brief Returns a dictionary to store thread-specific data, meaning it * returns a different dictionary for every thread. * * @return A dictionary to store thread-specific data. */ -+ (OFMutableDictionary *)threadDictionary; ++ (nullable OFMutableDictionary *)threadDictionary; #endif /*! * @brief Suspends execution of the current thread for the specified time * interval. @@ -200,24 +206,10 @@ * * @return The run loop for the thread */ - (OFRunLoop *)runLoop; -/*! - * @brief Returns the name of the thread or `nil` if none has been set. - * - * @return The name of the thread or nil if none has been set - */ -- (nullable OFString *)name; - -/*! - * @brief Sets the name for the thread. - * - * @param name The name for the thread - */ -- (void)setName: (nullable OFString *)name; - /*! * @brief Returns the priority of the thread. * * This is a value between -1.0 (meaning lowest priority that still schedules) * and +1.0 (meaning highest priority that still allows getting preempted)