2 ** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
6 // ToDo: this is a dummy implementation - I've not yet gained enough knowledge
7 // to decide how this should be done, so it's just broken now (okay for single
8 // threaded apps, though).
10 // we don't want to have the inline assembly included here
11 #ifndef _NO_INLINE_ASM
12 # define _NO_INLINE_ASM 1
15 #include "support/TLS.h"
19 static int32 gNextSlot
= TLS_FIRST_FREE_SLOT
;
20 static void *gSlots
[TLS_MAX_KEYS
];
26 int32 next
= atomic_add(&gNextSlot
, 1);
27 if (next
>= TLS_MAX_KEYS
)
42 tls_address(int32 index
)
44 return &gSlots
[index
];
49 tls_set(int32 index
, void *value
)
51 gSlots
[index
] = value
;