summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclInt.h28
-rw-r--r--generic/tclThread.c22
-rw-r--r--generic/tclThreadStorage.c32
-rw-r--r--generic/tclUtil.c4
-rw-r--r--unix/tclUnixThrd.c42
-rw-r--r--win/tclWinNotify.c4
-rw-r--r--win/tclWinThrd.c56
7 files changed, 94 insertions, 94 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index afb431c..c3801ee 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -1856,7 +1856,7 @@ typedef struct Interp {
* of hidden commands on a per-interp
* basis. */
void *interpInfo; /* Information used by tclInterp.c to keep
- * track of master/slave interps on a
+ * track of parent/child interps on a
* per-interp basis. */
union {
void (*optimizer)(void *envPtr);
@@ -2146,7 +2146,7 @@ typedef struct Interp {
* (c) are accessed very often (e.g., at each command call)
*
* Note that these are the same for all interps in the same thread. They
- * just have to be initialised for the thread's master interp, slaves
+ * just have to be initialised for the thread's parent interp, children
* inherit the value.
*
* They are used by the macros defined below.
@@ -2669,20 +2669,20 @@ typedef void (TclInitProcessGlobalValueProc)(char **valuePtr, unsigned int *leng
/*
* A ProcessGlobalValue struct exists for each internal value in Tcl that is
* to be shared among several threads. Each thread sees a (Tcl_Obj) copy of
- * the value, and the master is kept as a counted string, with epoch and mutex
- * control. Each ProcessGlobalValue struct should be a static variable in some
- * file.
+ * the value, and the gobal value is kept as a counted string, with epoch and
+ * mutex control. Each ProcessGlobalValue struct should be a static variable in
+ * some file.
*/
typedef struct ProcessGlobalValue {
unsigned int epoch; /* Epoch counter to detect changes in the
- * master value. */
- unsigned int numBytes; /* Length of the master string. */
- char *value; /* The master string value. */
- Tcl_Encoding encoding; /* system encoding when master string was
+ * global value. */
+ unsigned int numBytes; /* Length of the global string. */
+ char *value; /* The global string value. */
+ Tcl_Encoding encoding; /* system encoding when global string was
* initialized. */
TclInitProcessGlobalValueProc *proc;
- /* A procedure to initialize the master string
+ /* A procedure to initialize the global string
* copy when a "get" request comes in before
* any "set" request has been received. */
Tcl_Mutex mutex; /* Enforce orderly access from multiple
@@ -3157,8 +3157,8 @@ MODULE_SCOPE void TclpInitLock(void);
MODULE_SCOPE void TclpInitPlatform(void);
MODULE_SCOPE void TclpInitUnlock(void);
MODULE_SCOPE Tcl_Obj * TclpObjListVolumes(void);
-MODULE_SCOPE void TclpMasterLock(void);
-MODULE_SCOPE void TclpMasterUnlock(void);
+MODULE_SCOPE void TclpGlobalLock(void);
+MODULE_SCOPE void TclpGlobalUnlock(void);
MODULE_SCOPE int TclpMatchFiles(Tcl_Interp *interp, char *separators,
Tcl_DString *dirPtr, char *pattern, char *tail);
MODULE_SCOPE int TclpObjNormalizePath(Tcl_Interp *interp,
@@ -3305,8 +3305,8 @@ MODULE_SCOPE Tcl_WideInt TclpGetMicroseconds(void);
MODULE_SCOPE int TclZlibInit(Tcl_Interp *interp);
MODULE_SCOPE void * TclpThreadCreateKey(void);
MODULE_SCOPE void TclpThreadDeleteKey(void *keyPtr);
-MODULE_SCOPE void TclpThreadSetMasterTSD(void *tsdKeyPtr, void *ptr);
-MODULE_SCOPE void * TclpThreadGetMasterTSD(void *tsdKeyPtr);
+MODULE_SCOPE void TclpThreadSetGlobalTSD(void *tsdKeyPtr, void *ptr);
+MODULE_SCOPE void * TclpThreadGetGlobalTSD(void *tsdKeyPtr);
MODULE_SCOPE void TclErrorStackResetIf(Tcl_Interp *interp,
const char *msg, int length);
/* Tip 430 */
diff --git a/generic/tclThread.c b/generic/tclThread.c
index f22653a..76aaf4b 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -126,7 +126,7 @@ TclThreadDataKeyGet(
* Keep a list of (mutexes/condition variable/data key) used during
* finalization.
*
- * Assume master lock is held.
+ * Assume global lock is held.
*
* Results:
* None.
@@ -187,7 +187,7 @@ RememberSyncObject(
* ForgetSyncObject
*
* Remove a single object from the list.
- * Assume master lock is held.
+ * Assume global lock is held.
*
* Results:
* None.
@@ -219,7 +219,7 @@ ForgetSyncObject(
* TclRememberMutex
*
* Keep a list of mutexes used during finalization.
- * Assume master lock is held.
+ * Assume global lock is held.
*
* Results:
* None.
@@ -262,9 +262,9 @@ Tcl_MutexFinalize(
#if TCL_THREADS
TclpFinalizeMutex(mutexPtr);
#endif
- TclpMasterLock();
+ TclpGlobalLock();
ForgetSyncObject(mutexPtr, &mutexRecord);
- TclpMasterUnlock();
+ TclpGlobalUnlock();
}
/*
@@ -273,7 +273,7 @@ Tcl_MutexFinalize(
* TclRememberCondition
*
* Keep a list of condition variables used during finalization.
- * Assume master lock is held.
+ * Assume global lock is held.
*
* Results:
* None.
@@ -316,9 +316,9 @@ Tcl_ConditionFinalize(
#if TCL_THREADS
TclpFinalizeCondition(condPtr);
#endif
- TclpMasterLock();
+ TclpGlobalLock();
ForgetSyncObject(condPtr, &condRecord);
- TclpMasterUnlock();
+ TclpGlobalUnlock();
}
/*
@@ -382,7 +382,7 @@ TclFinalizeSynchronization(void)
Tcl_Mutex *mutexPtr;
Tcl_Condition *condPtr;
- TclpMasterLock();
+ TclpGlobalLock();
#endif
/*
@@ -404,7 +404,7 @@ TclFinalizeSynchronization(void)
#if TCL_THREADS
/*
- * Call thread storage master cleanup.
+ * Call thread storage global cleanup.
*/
TclFinalizeThreadStorage();
@@ -435,7 +435,7 @@ TclFinalizeSynchronization(void)
condRecord.max = 0;
condRecord.num = 0;
- TclpMasterUnlock();
+ TclpGlobalUnlock();
#endif /* TCL_THREADS */
}
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index 99e6bac..74c23af 100644
--- a/generic/tclThreadStorage.c
+++ b/generic/tclThreadStorage.c
@@ -27,11 +27,11 @@
*/
/*
- * The master collection of information about TSDs. This is shared across the
+ * The global collection of information about TSDs. This is shared across the
* whole process, and includes the mutex used to protect it.
*/
-static struct TSDMaster {
+static struct {
void *key; /* Key into the system TSD structure. The
* collection of Tcl TSD values for a
* particular thread will hang off the
@@ -41,13 +41,13 @@ static struct TSDMaster {
* increasing value. */
Tcl_Mutex mutex; /* Protection for the rest of this structure,
* which holds per-process data. */
-} tsdMaster = { NULL, 0, NULL };
+} tsdGlobal = { NULL, 0, NULL };
/*
* The type of the data held per thread in a system TSD.
*/
-typedef struct TSDTable {
+typedef struct {
ClientData *tablePtr; /* The table of Tcl TSDs. */
sig_atomic_t allocated; /* The size of the table in the current
* thread. */
@@ -57,7 +57,7 @@ typedef struct TSDTable {
* The actual type of Tcl_ThreadDataKey.
*/
-typedef union TSDUnion {
+typedef union {
volatile sig_atomic_t offset;
/* The type is really an offset into the
* thread-local table of TSDs, which is this
@@ -189,7 +189,7 @@ void *
TclThreadStorageKeyGet(
Tcl_ThreadDataKey *dataKeyPtr)
{
- TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetGlobalTSD(tsdGlobal.key);
ClientData resultPtr = NULL;
TSDUnion *keyPtr = (TSDUnion *) dataKeyPtr;
sig_atomic_t offset = keyPtr->offset;
@@ -223,12 +223,12 @@ TclThreadStorageKeySet(
Tcl_ThreadDataKey *dataKeyPtr,
void *value)
{
- TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetGlobalTSD(tsdGlobal.key);
TSDUnion *keyPtr = (TSDUnion *) dataKeyPtr;
if (tsdTablePtr == NULL) {
tsdTablePtr = TSDTableCreate();
- TclpThreadSetMasterTSD(tsdMaster.key, tsdTablePtr);
+ TclpThreadSetGlobalTSD(tsdGlobal.key, tsdTablePtr);
}
/*
@@ -240,15 +240,15 @@ TclThreadStorageKeySet(
*/
if (keyPtr->offset == 0) {
- Tcl_MutexLock(&tsdMaster.mutex);
+ Tcl_MutexLock(&tsdGlobal.mutex);
if (keyPtr->offset == 0) {
/*
* The Tcl_ThreadDataKey hasn't been used yet. Make a new one.
*/
- keyPtr->offset = ++tsdMaster.counter;
+ keyPtr->offset = ++tsdGlobal.counter;
}
- Tcl_MutexUnlock(&tsdMaster.mutex);
+ Tcl_MutexUnlock(&tsdGlobal.mutex);
}
/*
@@ -288,11 +288,11 @@ TclThreadStorageKeySet(
void
TclFinalizeThreadDataThread(void)
{
- TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetMasterTSD(tsdMaster.key);
+ TSDTable *tsdTablePtr = (TSDTable *)TclpThreadGetGlobalTSD(tsdGlobal.key);
if (tsdTablePtr != NULL) {
TSDTableDelete(tsdTablePtr);
- TclpThreadSetMasterTSD(tsdMaster.key, NULL);
+ TclpThreadSetGlobalTSD(tsdGlobal.key, NULL);
}
}
@@ -316,7 +316,7 @@ TclFinalizeThreadDataThread(void)
void
TclInitThreadStorage(void)
{
- tsdMaster.key = TclpThreadCreateKey();
+ tsdGlobal.key = TclpThreadCreateKey();
}
/*
@@ -339,8 +339,8 @@ TclInitThreadStorage(void)
void
TclFinalizeThreadStorage(void)
{
- TclpThreadDeleteKey(tsdMaster.key);
- tsdMaster.key = NULL;
+ TclpThreadDeleteKey(tsdGlobal.key);
+ tsdGlobal.key = NULL;
}
#else /* !TCL_THREADS */
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 8a995e5..5b296f0 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -4364,8 +4364,8 @@ TclGetProcessGlobalValue(
if (pgvPtr->encoding != current) {
/*
- * The system encoding has changed since the master string value
- * was saved. Convert the master value to be based on the new
+ * The system encoding has changed since the global string value
+ * was saved. Convert the global value to be based on the new
* system encoding.
*/
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 795c62c..7907732 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -169,12 +169,12 @@ static Tcl_ThreadDataKey dataKey;
#endif /* TCL_NO_DEPRECATED */
/*
- * masterLock is used to serialize creation of mutexes, condition variables,
+ * globalLock is used to serialize creation of mutexes, condition variables,
* and thread local storage. This is the only place that can count on the
* ability to statically initialize the mutex.
*/
-static pthread_mutex_t masterLock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t globalLock = PTHREAD_MUTEX_INITIALIZER;
/*
* initLock is used to serialize initialization and finalization of Tcl. It
@@ -423,7 +423,7 @@ TclFinalizeLock(void)
/*
* You do not need to destroy mutexes that were created with the
* PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need any
- * destruction: masterLock, allocLock, and initLock.
+ * destruction: globalLock, allocLock, and initLock.
*/
pthread_mutex_unlock(&initLock);
@@ -458,7 +458,7 @@ TclpInitUnlock(void)
/*
*----------------------------------------------------------------------
*
- * TclpMasterLock
+ * TclpGlobalLock
*
* This procedure is used to grab a lock that serializes creation and
* finalization of serialization objects. This interface is only needed
@@ -471,23 +471,23 @@ TclpInitUnlock(void)
* None.
*
* Side effects:
- * Acquire the master mutex.
+ * Acquire the global mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpMasterLock(void)
+TclpGlobalLock(void)
{
#if TCL_THREADS
- pthread_mutex_lock(&masterLock);
+ pthread_mutex_lock(&globalLock);
#endif
}
/*
*----------------------------------------------------------------------
*
- * TclpMasterUnlock
+ * TclpGlobalUnlock
*
* This procedure is used to release a lock that serializes creation and
* finalization of synchronization objects.
@@ -496,16 +496,16 @@ TclpMasterLock(void)
* None.
*
* Side effects:
- * Release the master mutex.
+ * Release the global mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpMasterUnlock(void)
+TclpGlobalUnlock(void)
{
#if TCL_THREADS
- pthread_mutex_unlock(&masterLock);
+ pthread_mutex_unlock(&globalLock);
#endif
}
@@ -571,10 +571,10 @@ Tcl_MutexLock(
PMutex *pmutexPtr;
if (*mutexPtr == NULL) {
- pthread_mutex_lock(&masterLock);
+ pthread_mutex_lock(&globalLock);
if (*mutexPtr == NULL) {
/*
- * Double inside master lock check to avoid a race condition.
+ * Double inside global lock check to avoid a race condition.
*/
pmutexPtr = (PMutex *)ckalloc(sizeof(PMutex));
@@ -582,7 +582,7 @@ Tcl_MutexLock(
*mutexPtr = (Tcl_Mutex) pmutexPtr;
TclRememberMutex(mutexPtr);
}
- pthread_mutex_unlock(&masterLock);
+ pthread_mutex_unlock(&globalLock);
}
pmutexPtr = *((PMutex **) mutexPtr);
PMutexLock(pmutexPtr);
@@ -622,7 +622,7 @@ Tcl_MutexUnlock(
* This procedure is invoked to clean up one mutex. This is only safe to
* call at the end of time.
*
- * This assumes the Master Lock is held.
+ * This assumes the Global Lock is held.
*
* Results:
* None.
@@ -679,7 +679,7 @@ Tcl_ConditionWait(
struct timespec ptime;
if (*condPtr == NULL) {
- pthread_mutex_lock(&masterLock);
+ pthread_mutex_lock(&globalLock);
/*
* Double check inside mutex to avoid race, then initialize condition
@@ -692,7 +692,7 @@ Tcl_ConditionWait(
*condPtr = (Tcl_Condition) pcondPtr;
TclRememberCondition(condPtr);
}
- pthread_mutex_unlock(&masterLock);
+ pthread_mutex_unlock(&globalLock);
}
pmutexPtr = *((PMutex **) mutexPtr);
pcondPtr = *((pthread_cond_t **) condPtr);
@@ -756,7 +756,7 @@ Tcl_ConditionNotify(
* This procedure is invoked to clean up a condition variable. This is
* only safe to call at the end of time.
*
- * This assumes the Master Lock is held.
+ * This assumes the Global Lock is held.
*
* Results:
* None.
@@ -943,19 +943,19 @@ TclpThreadDeleteKey(
}
void
-TclpThreadSetMasterTSD(
+TclpThreadSetGlobalTSD(
void *tsdKeyPtr,
void *ptr)
{
pthread_key_t *ptkeyPtr = (pthread_key_t *)tsdKeyPtr;
if (pthread_setspecific(*ptkeyPtr, ptr)) {
- Tcl_Panic("unable to set master TSD value");
+ Tcl_Panic("unable to set global TSD value");
}
}
void *
-TclpThreadGetMasterTSD(
+TclpThreadGetGlobalTSD(
void *tsdKeyPtr)
{
pthread_key_t *ptkeyPtr = (pthread_key_t*)tsdKeyPtr;
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index 2ab4efa..7d5249d 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -84,12 +84,12 @@ Tcl_InitNotifier(void)
} else {
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- TclpMasterLock();
+ TclpGlobalLock();
if (!initialized) {
initialized = 1;
InitializeCriticalSection(&notifierMutex);
}
- TclpMasterUnlock();
+ TclpGlobalUnlock();
/*
* Register Notifier window class if this is the first thread to use
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 89f2b12..abd4f84 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -22,15 +22,15 @@ _CRTIMP unsigned int __cdecl _controlfp (unsigned int unNew, unsigned int unMask
#endif
/*
- * This is the master lock used to serialize access to other serialization
+ * This is the global lock used to serialize access to other serialization
* data structures.
*/
-static CRITICAL_SECTION masterLock;
+static CRITICAL_SECTION globalLock;
static int initialized = 0;
/*
- * This is the master lock used to serialize initialization and finalization
+ * This is the global lock used to serialize initialization and finalization
* of Tcl as a whole.
*/
@@ -362,7 +362,7 @@ TclpInitLock(void)
initialized = 1;
InitializeCriticalSection(&joinLock);
InitializeCriticalSection(&initLock);
- InitializeCriticalSection(&masterLock);
+ InitializeCriticalSection(&globalLock);
}
EnterCriticalSection(&initLock);
}
@@ -393,7 +393,7 @@ TclpInitUnlock(void)
/*
*----------------------------------------------------------------------
*
- * TclpMasterLock
+ * TclpGlobalLock
*
* This procedure is used to grab a lock that serializes creation of
* mutexes, condition variables, and thread local storage keys.
@@ -405,13 +405,13 @@ TclpInitUnlock(void)
* None.
*
* Side effects:
- * Acquire the master mutex.
+ * Acquire the global mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpMasterLock(void)
+TclpGlobalLock(void)
{
if (!initialized) {
/*
@@ -424,15 +424,15 @@ TclpMasterLock(void)
initialized = 1;
InitializeCriticalSection(&joinLock);
InitializeCriticalSection(&initLock);
- InitializeCriticalSection(&masterLock);
+ InitializeCriticalSection(&globalLock);
}
- EnterCriticalSection(&masterLock);
+ EnterCriticalSection(&globalLock);
}
/*
*----------------------------------------------------------------------
*
- * TclpMasterUnlock
+ * TclpGlobalUnlock
*
* This procedure is used to release a lock that serializes creation and
* deletion of synchronization objects.
@@ -441,15 +441,15 @@ TclpMasterLock(void)
* None.
*
* Side effects:
- * Release the master mutex.
+ * Release the global mutex.
*
*----------------------------------------------------------------------
*/
void
-TclpMasterUnlock(void)
+TclpGlobalUnlock(void)
{
- LeaveCriticalSection(&masterLock);
+ LeaveCriticalSection(&globalLock);
}
/*
@@ -506,14 +506,14 @@ Tcl_GetAllocMutex(void)
void
TclFinalizeLock(void)
{
- TclpMasterLock();
+ TclpGlobalLock();
DeleteCriticalSection(&joinLock);
/*
* Destroy the critical section that we are holding!
*/
- DeleteCriticalSection(&masterLock);
+ DeleteCriticalSection(&globalLock);
initialized = 0;
#if TCL_THREADS
@@ -561,10 +561,10 @@ Tcl_MutexLock(
CRITICAL_SECTION *csPtr;
if (*mutexPtr == NULL) {
- TclpMasterLock();
+ TclpGlobalLock();
/*
- * Double inside master lock check to avoid a race.
+ * Double inside global lock check to avoid a race.
*/
if (*mutexPtr == NULL) {
@@ -573,7 +573,7 @@ Tcl_MutexLock(
*mutexPtr = (Tcl_Mutex)csPtr;
TclRememberMutex(mutexPtr);
}
- TclpMasterUnlock();
+ TclpGlobalUnlock();
}
csPtr = *((CRITICAL_SECTION **)mutexPtr);
EnterCriticalSection(csPtr);
@@ -675,7 +675,7 @@ Tcl_ConditionWait(
*/
if (tsdPtr->flags == WIN_THREAD_UNINIT) {
- TclpMasterLock();
+ TclpGlobalLock();
/*
* Create the per-thread event and queue pointers.
@@ -689,14 +689,14 @@ Tcl_ConditionWait(
tsdPtr->flags = WIN_THREAD_RUNNING;
doExit = 1;
}
- TclpMasterUnlock();
+ TclpGlobalUnlock();
if (doExit) {
/*
* Create a per-thread exit handler to clean up the condEvent. We
- * must be careful to do this outside the Master Lock because
+ * must be careful to do this outside the Global Lock because
* Tcl_CreateThreadExitHandler uses its own ThreadSpecificData,
- * and initializing that may drop back into the Master Lock.
+ * and initializing that may drop back into the Global Lock.
*/
Tcl_CreateThreadExitHandler(FinalizeConditionEvent, tsdPtr);
@@ -704,7 +704,7 @@ Tcl_ConditionWait(
}
if (*condPtr == NULL) {
- TclpMasterLock();
+ TclpGlobalLock();
/*
* Initialize the per-condition queue pointers and Mutex.
@@ -718,7 +718,7 @@ Tcl_ConditionWait(
*condPtr = (Tcl_Condition) winCondPtr;
TclRememberCondition(condPtr);
}
- TclpMasterUnlock();
+ TclpGlobalUnlock();
}
csPtr = *((CRITICAL_SECTION **)mutexPtr);
winCondPtr = *((WinCondition **)condPtr);
@@ -896,7 +896,7 @@ FinalizeConditionEvent(
* This procedure is invoked to clean up a condition variable. This is
* only safe to call at the end of time.
*
- * This assumes the Master Lock is held.
+ * This assumes the Global Lock is held.
*
* Results:
* None.
@@ -1065,19 +1065,19 @@ TclpThreadDeleteKey(
}
void
-TclpThreadSetMasterTSD(
+TclpThreadSetGlobalTSD(
void *tsdKeyPtr,
void *ptr)
{
DWORD *key = (DWORD *)tsdKeyPtr;
if (!TlsSetValue(*key, ptr)) {
- Tcl_Panic("unable to set master TSD value");
+ Tcl_Panic("unable to set global TSD value");
}
}
void *
-TclpThreadGetMasterTSD(
+TclpThreadGetGlobalTSD(
void *tsdKeyPtr)
{
DWORD *key = (DWORD *)tsdKeyPtr;