11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-
+
|
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
#ifdef TCL_THREADS
typedef struct ThreadSpecificData {
typedef struct {
char nabuf[16];
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
/*
* masterLock is used to serialize creation of mutexes, condition variables,
|
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
|
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
|
-
+
-
+
-
+
|
/*
* Additions by AOL for specialized thread memory allocator.
*/
static volatile int initialized = 0;
static pthread_key_t key;
typedef struct allocMutex {
typedef struct {
Tcl_Mutex tlock;
pthread_mutex_t plock;
} allocMutex;
Tcl_Mutex *
TclpNewAllocMutex(void)
{
struct allocMutex *lockPtr;
allocMutex *lockPtr;
register pthread_mutex_t *plockPtr;
lockPtr = malloc(sizeof(struct allocMutex));
lockPtr = malloc(sizeof(allocMutex));
if (lockPtr == NULL) {
Tcl_Panic("could not allocate lock");
}
plockPtr = &lockPtr->plock;
lockPtr->tlock = (Tcl_Mutex) plockPtr;
pthread_mutex_init(&lockPtr->plock, NULL);
return &lockPtr->tlock;
|