103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
-
+
-
+
-
+
|
#define WIN_THREAD_BLOCKED 0x2
/*
* The per condition queue pointers and the Mutex used to serialize access to
* the queue.
*/
typedef struct WinCondition {
typedef struct {
CRITICAL_SECTION condLock; /* Lock to serialize queuing on the
* condition. */
struct ThreadSpecificData *firstPtr; /* Queue pointers */
struct ThreadSpecificData *lastPtr;
} WinCondition;
/*
* Additions by AOL for specialized thread memory allocator.
*/
#ifdef USE_THREAD_ALLOC
static DWORD tlsKey;
typedef struct allocMutex {
typedef struct {
Tcl_Mutex tlock;
CRITICAL_SECTION wlock;
} allocMutex;
#endif /* USE_THREAD_ALLOC */
/*
* The per thread data passed from TclpThreadCreate
* to TclWinThreadStart.
*/
typedef struct WinThread {
typedef struct {
LPTHREAD_START_ROUTINE lpStartAddress; /* Original startup routine */
LPVOID lpParameter; /* Original startup data */
unsigned int fpControl; /* Floating point control word from the
* main thread */
} WinThread;
|
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
-
+
-
+
|
* Additions by AOL for specialized thread memory allocator.
*/
#ifdef USE_THREAD_ALLOC
Tcl_Mutex *
TclpNewAllocMutex(void)
{
struct allocMutex *lockPtr;
allocMutex *lockPtr;
lockPtr = malloc(sizeof(struct allocMutex));
lockPtr = malloc(sizeof(allocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
lockPtr->tlock = (Tcl_Mutex) &lockPtr->wlock;
InitializeCriticalSection(&lockPtr->wlock);
return &lockPtr->tlock;
}
|