@@ -18,10 +18,12 @@ #ifdef OF_HAVE_THREADS # import "threading.h" #endif +OF_ASSUME_NONNULL_BEGIN + /*! @file */ @class OFDate; @class OFRunLoop; @class OFMutableDictionary OF_GENERIC(KeyType, ObjectType); @@ -30,11 +32,11 @@ /*! * @brief A block to be executed in a new thread. * * @return The object which should be returned when the thread is joined */ -typedef id (^of_thread_block_t)(void); +typedef __nullable id (^of_thread_block_t)(void); #endif /*! * @class OFThread OFThread.h ObjFW/OFThread.h * @@ -154,11 +156,11 @@ /*! * @brief Terminates the current thread, letting it return the specified object. * * @param object The object which the terminated thread will return */ -+ (void)terminateWithObject: (id)object OF_NO_RETURN; ++ (void)terminateWithObject: (nullable id)object OF_NO_RETURN; # ifdef OF_HAVE_BLOCKS /*! * @brief Initializes an already allocated thread with the specified block. * @@ -174,11 +176,11 @@ * It can access the object passed to the threadWithObject or initWithObject * method using the instance variable named object. * * @return The object the join method should return when called for this thread */ -- (id)main; +- (nullable id)main; /*! * @brief This routine is exectued when the thread's main method has finished * executing or terminate has been called. * @@ -208,18 +210,18 @@ /*! * @brief Returns the name of the thread or nil if none has been set. * * @return The name of the thread or nik if none has been set */ -- (OFString*)name; +- (nullable OFString*)name; /*! * @brief Sets the name for the thread. * * @param name The name for the thread */ -- (void)setName: (OFString*)name; +- (void)setName: (nullable OFString*)name; /*! * @brief Returns the priority of the thread. * * @return The priority of the thread @@ -251,5 +253,7 @@ * @param stackSize The stack size for the thread */ - (void)setStackSize: (size_t)stackSize; #endif @end + +OF_ASSUME_NONNULL_END