Overview
Comment: | threading_pthread.m: More fault tolerant init
This fixes NetBSD 8. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
cdd30dfb532e89dce27ac1ee03606782 |
User & Date: | js on 2018-10-20 17:48:40 |
Other Links: | manifest | tags |
Context
2018-10-21
| ||
17:33 | platform.h: Add Acorn RISC OS check-in: de8e81d3b0 user: js tags: trunk | |
2018-10-20
| ||
17:48 | threading_pthread.m: More fault tolerant init check-in: cdd30dfb53 user: js tags: trunk | |
2018-10-16
| ||
00:07 | Remove intermediate OFASN1IntegerOrEnumerated check-in: 52b963d843 user: js tags: trunk | |
Changes
Modified src/threading_pthread.m from [5bca66cb41] to [b133b4ffce].
︙ | ︙ | |||
23 24 25 26 27 28 29 | #import "macros.h" #ifdef OF_HAIKU # include <kernel/OS.h> #endif | | > > | | < | | | | < > > | > > | > > | > > | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #import "macros.h" #ifdef OF_HAIKU # include <kernel/OS.h> #endif static int minPrio = 0, maxPrio = 0, normalPrio = 0; struct thread_ctx { void (*function)(id object); id object; }; /* * This is done here to make sure this is done as early as possible in the main * thread. */ OF_CONSTRUCTOR() { pthread_attr_t pattr; if (pthread_attr_init(&pattr) == 0) { #ifdef HAVE_PTHREAD_ATTR_GETSCHEDPOLICY int policy; #endif struct sched_param param; #ifdef HAVE_PTHREAD_ATTR_GETSCHEDPOLICY if (pthread_attr_getschedpolicy(&pattr, &policy) == 0) { minPrio = sched_get_priority_min(policy); maxPrio = sched_get_priority_max(policy); if (minPrio == -1 || maxPrio == -1) minPrio = maxPrio = 0; } if (pthread_attr_getschedparam(&pattr, ¶m) != 0) normalPrio = param.sched_priority; else minPrio = maxPrio = 0; pthread_attr_destroy(&pattr); #endif } } static void * function_wrapper(void *data) { struct thread_ctx *ctx = data; |
︙ | ︙ |