Differences From Artifact [d3db130196]:
- File
src/OFThread.m
— part of check-in
[a0b63a8df4]
at
2013-12-01 02:08:43
on branch trunk
— Port to DOS/DJGPP.
The port was much easier than expected. The only changes that were
required were defining the missing lrint() and useconds_t, the rest was
optional (like using backslashes for paths, even though slashes work
fine). (user: js, size: 7383) [annotate] [blame] [check-ins using]
To Artifact [8a5ecd213c]:
- File
src/OFThread.m
— part of check-in
[fa6496efc7]
at
2013-12-05 17:48:11
on branch trunk
— Make coding style consistent.
A file documenting the coding style will be written soon. This will
hopefully prevent conflicts in the future, such as whether static
functions are written in camelCase or_with_underscores, like was the
case here. (user: js, size: 7375) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
74 75 76 77 78 79 80 | #ifdef OF_HAVE_THREADS # import "threading.h" static of_tlskey_t threadSelfKey; static OFThread *mainThread; static id | | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #ifdef OF_HAVE_THREADS # import "threading.h" static of_tlskey_t threadSelfKey; static OFThread *mainThread; static id callMain(id object) { OFThread *thread = (OFThread*)object; if (!of_tlskey_set(threadSelfKey, thread)) @throw [OFInitializationFailedException exceptionWithClass: [thread class]]; |
︙ | ︙ | |||
108 109 110 111 112 113 114 | [thread release]; return 0; } static void | | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | [thread release]; return 0; } static void setThreadName(OFThread *thread) { # ifdef __HAIKU__ OFString *name = thread->_name; if (name == nil) name = [thread className]; |
︙ | ︙ | |||
298 299 300 301 302 303 304 | [_returnValue release]; } [self retain]; _running = OF_THREAD_RUNNING; | | | | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | [_returnValue release]; } [self retain]; _running = OF_THREAD_RUNNING; if (!of_thread_new(&_thread, callMain, self)) { [self release]; @throw [OFThreadStartFailedException exceptionWithThread: self]; } setThreadName(self); } - (id)join { if (_running == OF_THREAD_NOT_RUNNING || !of_thread_join(_thread)) @throw [OFThreadJoinFailedException exceptionWithThread: self]; |
︙ | ︙ | |||
350 351 352 353 354 355 356 | } - (void)setName: (OFString*)name { OF_SETTER(_name, name, true, 1) if (_running == OF_THREAD_RUNNING) | | | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | } - (void)setName: (OFString*)name { OF_SETTER(_name, name, true, 1) if (_running == OF_THREAD_RUNNING) setThreadName(self); } - (void)dealloc { if (_running == OF_THREAD_RUNNING) @throw [OFThreadStillRunningException exceptionWithThread: self]; |
︙ | ︙ |