Commit | Line | Data |
---|---|---|
2986a63f JH |
1 | |
2 | /* | |
3 | * Copyright © 2001 Novell, Inc. All Rights Reserved. | |
4 | * | |
5 | * You may distribute under the terms of either the GNU General Public | |
6 | * License or the Artistic License, as specified in the README file. | |
7 | * | |
8 | */ | |
9 | ||
10 | /* | |
9219c8de JH |
11 | * FILENAME : NWTInfo.h |
12 | * DESCRIPTION : Thread-local storage for Perl. | |
13 | * Author : SGP, HYAK | |
14 | * Date Created : January 2001. | |
15 | * Date Modified: July 2nd 2001. | |
2986a63f JH |
16 | */ |
17 | ||
18 | ||
19 | ||
20 | #ifndef __NWTInfo_H__ | |
21 | #define __NWTInfo_H__ | |
22 | ||
23 | ||
24 | #include "win32ish.h" // For "BOOL", "TRUE" and "FALSE" | |
25 | ||
26 | typedef struct tagThreadInfo | |
27 | { | |
28 | int tid; | |
29 | struct tagThreadInfo *next; | |
30 | BOOL m_dontTouchHashLists; | |
31 | void* m_allocList; | |
32 | }ThreadInfo; | |
33 | ||
2986a63f JH |
34 | void fnInitializeThreadInfo(void); |
35 | BOOL fnTerminateThreadInfo(void); | |
2986a63f JH |
36 | |
37 | ThreadInfo* fnAddThreadInfo(int tid); | |
38 | BOOL fnRemoveThreadInfo(int tid); | |
39 | ThreadInfo* fnGetThreadInfo(int tid); | |
40 | ||
8dbfbba0 | 41 | #ifdef __cplusplus |
9219c8de | 42 | //For storing and retrieving Watcom Hash list address |
8dbfbba0 | 43 | extern "C" BOOL fnInsertHashListAddrs(void *addrs, BOOL dontTouchHashList); |
9219c8de JH |
44 | //Registering with the Thread table |
45 | extern "C" BOOL fnRegisterWithThreadTable(void); | |
46 | extern "C" BOOL fnUnregisterWithThreadTable(void); | |
8dbfbba0 | 47 | #else |
9219c8de | 48 | //For storing and retrieving Watcom Hash list address |
8dbfbba0 | 49 | BOOL fnInsertHashListAddrs(void *addrs, BOOL dontTouchHashList); |
9219c8de JH |
50 | //Registering with the Thread table |
51 | BOOL fnRegisterWithThreadTable(void); | |
52 | BOOL fnUnregisterWithThreadTable(void); | |
8dbfbba0 | 53 | #endif |
9219c8de | 54 | |
2986a63f JH |
55 | BOOL fnGetHashListAddrs(void **addrs, BOOL *dontTouchHashList); |
56 | ||
57 | //New TLS to set and get the thread contex - may be redundant, | |
58 | //or see if the above portion can be removed once this works properly | |
59 | typedef struct tagThreadCtx | |
60 | { | |
61 | long tid; | |
62 | void *tInfo; | |
63 | struct tagThreadCtx *next; | |
64 | }ThreadContext; | |
65 | ||
66 | ||
67 | long fnInitializeThreadCtx(void); | |
68 | ThreadContext* fnAddThreadCtx(long lTLSIndex, void *t); | |
69 | BOOL fnRemoveThreadCtx(long lTLSIndex); | |
70 | void* fnGetThreadCtx(long lTLSIndex); | |
71 | ||
72 | #endif // __NWTInfo_H__ | |
73 |