Overview
Comment: | Make the main thread an OFThread. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ead7b7acd3d4429dbc6dd689b5262e4e |
User & Date: | js on 2012-09-09 17:48:39 |
Other Links: | manifest | tags |
Context
2012-09-09
| ||
17:50 | Make thread ivars private. check-in: 3b1c4cc681 user: js tags: trunk | |
17:48 | Make the main thread an OFThread. check-in: ead7b7acd3 user: js tags: trunk | |
14:36 | Add OFSortedList. check-in: c0f28cf861 user: js tags: trunk | |
Changes
Modified src/OFApplication.m from [a06fbcf0e7] to [6f344c5f2e].
︙ | |||
291 292 293 294 295 296 297 298 299 300 301 302 303 304 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | + + | REGISTER_SIGNAL(SIGUSR2) #endif #undef REGISTER_SIGNAL } - (void)run { [OFThread _createMainThread]; [delegate applicationDidFinishLaunching]; for (;;) [OFThread sleepForTimeInterval: 86400]; } - (void)terminate |
︙ |
Modified src/OFThread.h from [51a42ce92e] to [3a25c292f8].
︙ | |||
152 153 154 155 156 157 158 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + + + + + + + + | * \param key The Thread Local Storage key */ + (id)objectForTLSKey: (OFTLSKey*)key; /** * \brief Returns the current thread. * |
︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | + + | /** * \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; + (void)_createMainThread; /** * \brief Initializes an already allocated thread with the specified object. * * \param object An object which is passed for use in the main method or nil * \return An initialized OFThread. */ |
︙ |
Modified src/OFThread.m from [b522bb5862] to [413ce95285].
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + + - + | #import "OFThreadJoinFailedException.h" #import "OFThreadStartFailedException.h" #import "OFThreadStillRunningException.h" #import "threading.h" static OFList *TLSKeys; |
︙ | |||
94 95 96 97 98 99 100 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | - + | #endif + (void)initialize { if (self != [OFThread class]) return; |
︙ | |||
142 143 144 145 146 147 148 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | - + + + + + + | + (id)objectForTLSKey: (OFTLSKey*)key { return [[(id)of_tlskey_get(key->key) retain] autorelease]; } + (OFThread*)currentThread { |
︙ | |||
198 199 200 201 202 203 204 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + + + + + + + + + + + | + (void)terminate { [self terminateWithObject: nil]; } + (void)terminateWithObject: (id)object { |
︙ |