Differences From Artifact [e635f40c39]:
- File
src/OFThread.m
— part of check-in
[1494d3f6f1]
at
2017-10-07 10:46:11
on branch trunk
— OFThread: Fix setting the name on the wrong thread
The name of the thread may only be set from the thread itself. So the
thread should read the property on start and set its name. (user: js, size: 8775) [annotate] [blame] [check-ins using]
To Artifact [2f9aa72b9d]:
- File src/OFThread.m — part of check-in [76ee8ab481] at 2017-10-07 14:57:14 on branch trunk — OFThread: Support setting the name while running (user: js, size: 9152) [annotate] [blame] [check-ins using]
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - - - - - - - + + + + + + + + | #ifdef OF_NINTENDO_3DS # include <3ds/svc.h> #endif #import "OFThread.h" #import "OFThread+Private.h" |
︙ | |||
267 268 269 270 271 272 273 274 275 276 277 278 279 280 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | + + + + + + + + + + + + + + + + | [OFAutoreleasePool of_handleThreadTermination]; [thread release]; of_thread_exit(); } + (void)setName: (OFString *)name { [[OFThread currentThread] setName: name]; if (name != nil) of_thread_set_name( [name cStringWithEncoding: [OFLocalization encoding]]); else of_thread_set_name(class_getName([self class])); } + (OFString *)name { return [[OFThread currentThread] name]; } + (void)of_createMainThread { mainThread = [[OFThread alloc] init]; mainThread->_thread = of_thread_current(); if (!of_tlskey_set(threadSelfKey, mainThread)) |
︙ | |||
348 349 350 351 352 353 354 | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | - + + | if (!of_thread_new(&_thread, callMain, self, &_attr)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } if (_name != nil) |
︙ |