blob: a08d060422c2039ff9c4217cf91dadbdf2897613 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
|
/*
* Copyright © 2001 Novell, Inc. All Rights Reserved.
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
*/
/*
* FILENAME : NWTInfo.h
* DESCRIPTION : Thread-local storage for Perl.
* Author : SGP, HYAK
* Date Created : January 2001.
* Date Modified: July 2nd 2001.
*/
#ifndef __NWTInfo_H__
#define __NWTInfo_H__
#include "win32ish.h" // For "BOOL", "TRUE" and "FALSE"
typedef struct tagThreadInfo
{
int tid;
struct tagThreadInfo *next;
BOOL m_dontTouchHashLists;
void* m_allocList;
}ThreadInfo;
void fnInitializeThreadInfo(void);
BOOL fnTerminateThreadInfo(void);
ThreadInfo* fnAddThreadInfo(int tid);
BOOL fnRemoveThreadInfo(int tid);
ThreadInfo* fnGetThreadInfo(int tid);
#ifdef __cplusplus
//For storing and retrieving Watcom Hash list address
extern "C" BOOL fnInsertHashListAddrs(void *addrs, BOOL dontTouchHashList);
//Registering with the Thread table
extern "C" BOOL fnRegisterWithThreadTable(void);
extern "C" BOOL fnUnregisterWithThreadTable(void);
#else
//For storing and retrieving Watcom Hash list address
BOOL fnInsertHashListAddrs(void *addrs, BOOL dontTouchHashList);
//Registering with the Thread table
BOOL fnRegisterWithThreadTable(void);
BOOL fnUnregisterWithThreadTable(void);
#endif
BOOL fnGetHashListAddrs(void **addrs, BOOL *dontTouchHashList);
//New TLS to set and get the thread contex - may be redundant,
//or see if the above portion can be removed once this works properly
typedef struct tagThreadCtx
{
long tid;
void *tInfo;
struct tagThreadCtx *next;
}ThreadContext;
long fnInitializeThreadCtx(void);
ThreadContext* fnAddThreadCtx(long lTLSIndex, void *t);
BOOL fnRemoveThreadCtx(long lTLSIndex);
void* fnGetThreadCtx(long lTLSIndex);
#endif // __NWTInfo_H__
|