Differences From Artifact [b4c8773e10]:
- File
src/OFThread.h
— part of check-in
[71d45a29d1]
at
2013-04-26 20:40:43
on branch trunk
— Make sure +[OFThread sleep*] is always available.
This means that even if --disable-threads has been specified, it is
possible to use +[OFThread sleep*] to sleep the current (and only)
thread. (user: js, size: 5523) [annotate] [blame] [check-ins using]
To Artifact [a1b30840b5]:
- File
src/OFThread.h
— part of check-in
[a3639589d3]
at
2013-06-30 18:30:12
on branch trunk
— Rename -[initWithBlock:].
It is now called -[initWithThreadBlock:] in order to prevent method
signature conflicts.This also fixes a missing release for the thread block. (user: js, size: 5571) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
64 65 66 67 68 69 70 | of_thread_t _thread; enum { OF_THREAD_NOT_RUNNING, OF_THREAD_RUNNING, OF_THREAD_WAITING_FOR_JOIN } _running; # ifdef OF_HAVE_BLOCKS | | | | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | of_thread_t _thread; enum { OF_THREAD_NOT_RUNNING, OF_THREAD_RUNNING, OF_THREAD_WAITING_FOR_JOIN } _running; # ifdef OF_HAVE_BLOCKS of_thread_block_t _threadBlock; # endif id _returnValue; OFRunLoop *_runLoop; OFString *_name; } # ifdef OF_HAVE_PROPERTIES # ifdef OF_HAVE_BLOCKS @property (copy) of_thread_block_t threadBlock; # endif @property (copy) OFString *name; # endif /*! * @brief Creates a new thread. * * @return A new, autoreleased thread */ + (instancetype)thread; # ifdef OF_HAVE_BLOCKS /*! * @brief Creates a new thread with the specified block. * * @param threadBlock A block which is executed by the thread * @return A new, autoreleased thread */ + (instancetype)threadWithThreadBlock: (of_thread_block_t)threadBlock; # endif /*! * @brief 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 |
︙ | ︙ | |||
173 174 175 176 177 178 179 | + (void)OF_createMainThread; # ifdef OF_HAVE_BLOCKS /*! * @brief Initializes an already allocated thread with the specified block. * | | | | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | + (void)OF_createMainThread; # ifdef OF_HAVE_BLOCKS /*! * @brief Initializes an already allocated thread with the specified block. * * @param threadBlock A block which is executed by the thread * @return An initialized OFThread. */ - initWithThreadBlock: (of_thread_block_t)threadBlock; # endif /*! * @brief 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. |
︙ | ︙ |