Overview
Comment: | threading_pthread.m: Set thread name |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
39f5e202018421b8c8fe209ae51ecc97 |
User & Date: | js on 2014-08-11 18:44:53 |
Other Links: | manifest | tags |
Context
2014-08-17
| ||
10:42 | Remove asprintf.[hm] from Xcode project check-in: 9dd18eddc4 user: js tags: trunk | |
2014-08-11
| ||
18:44 | threading_pthread.m: Set thread name check-in: 39f5e20201 user: js tags: trunk | |
2014-08-07
| ||
20:20 | Fix generators/Makefile on OS X check-in: 21d8c47508 user: js tags: trunk | |
Changes
Modified configure.ac from [1aff663ede] to [a2e5f9a1de].
︙ | |||
546 547 548 549 550 551 552 553 554 555 556 557 558 559 | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | + + + + | [Whether we have pthread spinlocks]) ]) AC_CHECK_FUNC(sched_yield, [ AC_DEFINE(OF_HAVE_SCHED_YIELD, 1, [Whether we have sched_yield()]) ]) AC_CHECK_HEADERS(pthread_np.h) AC_CHECK_FUNCS(pthread_set_name_np pthread_setname_np, break) ], [ AC_MSG_ERROR(No supported threads found!) ]) ;; esac AC_DEFINE(OF_HAVE_THREADS, 1, [Whether we have threads]) |
︙ |
Modified src/threading.m from [21c1e4f75c] to [ac9dc3c880].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - - - - - - - - | # error No threads available! #endif #ifdef __HAIKU__ # include <kernel/OS.h> #endif |
︙ |
Modified src/threading_pthread.m from [967081c426] to [3c16bc0403].
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | + + + + | * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #ifdef HAVE_PTHREAD_NP_H # include <pthread_np.h> #endif struct thread_ctx { void (*function)(id object); id object; }; static void* |
︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | + + + + + + + + + + + + + + + + + + + + + | void OF_NO_RETURN of_thread_exit(void) { pthread_exit(NULL); OF_UNREACHABLE } void of_thread_set_name(of_thread_t thread, const char *name) { #if defined(__HAIKU__) rename_thread(get_pthread_thread_id(thread), name); #elif defined(HAVE_PTHREAD_SET_NAME_NP) pthread_set_name_np(pthread_self(), name); #elif defined(HAVE_PTHREAD_SETNAME_NP) # if defined(__APPLE__) pthread_setname_np(name); # elif defined(__GLIBC__) char buffer[16]; strncpy(buffer, name, 15); buffer[15] = 0; pthread_setname_np(pthread_self(), buffer); # endif #endif } void of_once(of_once_t *control, void (*func)(void)) { pthread_once(control, func); } |
︙ |
Modified src/threading_winapi.m from [b5d0945c6a] to [68869a7c20].
︙ | |||
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + + + + + | void OF_NO_RETURN of_thread_exit(void) { ExitThread(0); OF_UNREACHABLE } void of_thread_set_name(of_thread_t thread, const char *name) { } void of_once(of_once_t *control, void (*func)(void)) { switch (InterlockedCompareExchange(control, 1, 0)) { case 0: func(); |
︙ |