Differences From Artifact [32bd25a13e]:
- File
src/tlskey.h
— part of check-in
[49aee5736e]
at
2020-01-25 20:04:54
on branch trunk
— tlskey.m: Use hashtable from runtime on AmigaOS
tlskey.m used OFMapTable only on AmigaOS. This became a problem when
autorelease pools were moved into the runtime, as autorelease pools use
TLS. The build then broke, as there suddenly was a dependency from the
runtime on ObjFW.This now uses the hashtable from the runtime and also no longer uses
OFList, thus fixing the build. As we always use the runtime on AmigaOS
anyway, this is fine. (user: js, size: 2046) [annotate] [blame] [check-ins using] [more...]
To Artifact [19e6f1fad4]:
- File src/tlskey.h — part of check-in [c75596237e] at 2020-12-06 01:54:02 on branch trunk — Use OS-native TLS keys on MorphOS (user: js, size: 2349) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #if defined(OF_HAVE_PTHREADS) # include <pthread.h> typedef pthread_key_t of_tlskey_t; #elif defined(OF_WINDOWS) # include <windows.h> typedef DWORD of_tlskey_t; #elif defined(OF_AMIGAOS) typedef struct of_tlskey { struct objc_hashtable *table; struct of_tlskey *next, *previous; } *of_tlskey_t; #endif | > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #if defined(OF_HAVE_PTHREADS) # include <pthread.h> typedef pthread_key_t of_tlskey_t; #elif defined(OF_WINDOWS) # include <windows.h> typedef DWORD of_tlskey_t; #elif defined(OF_MORPHOS) # include <proto/exec.h> typedef ULONG of_tlskey_t; #elif defined(OF_AMIGAOS) typedef struct of_tlskey { struct objc_hashtable *table; struct of_tlskey *next, *previous; } *of_tlskey_t; #endif |
︙ | ︙ | |||
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | } static OF_INLINE bool of_tlskey_set(of_tlskey_t key, void *ptr) { return TlsSetValue(key, ptr); } #elif defined(OF_AMIGAOS) /* Those are too big too inline. */ # ifdef __cplusplus extern "C" { # endif extern void *of_tlskey_get(of_tlskey_t key); extern bool of_tlskey_set(of_tlskey_t key, void *ptr); # ifdef __cplusplus } # endif #endif | > > > > > > > > > > > > | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | } static OF_INLINE bool of_tlskey_set(of_tlskey_t key, void *ptr) { return TlsSetValue(key, ptr); } #elif defined(OF_MORPHOS) static OF_INLINE void * of_tlskey_get(of_tlskey_t key) { return (void *)TLSGetValue(key); } static OF_INLINE bool of_tlskey_set(of_tlskey_t key, void *ptr) { return TLSSetValue(key, (APTR)ptr); } #elif defined(OF_AMIGAOS) /* Those are too big too inline. */ # ifdef __cplusplus extern "C" { # endif extern void *of_tlskey_get(of_tlskey_t key); extern bool of_tlskey_set(of_tlskey_t key, void *ptr); # ifdef __cplusplus } # endif #endif |