OriginalBugID: 5254 Bug
Version: 8.3
SubmitDate: '2000-04-25'
LastModified: '2000-04-25'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: AIX
OSVersion: AIX 4.3.3
FixedDate: '2000-04-25'
FixedInVersion: 8.3.1
ClosedDate: '2000-10-25'
Name:
Valdis Kletnieks
CVS:
SCCS: @(#) tclUnixThrd.c 1.18 98/02/19 14:24:12
Comments:
The provided patch is *KNOWN SUBOPTIMAL*. It got me a working compile,
but should almost certainly be handled in another way. A quick check of
Solaris 2.6 and 2.7 show two different definitions of
PTHREAD_MUTEX_INITIALIZER, but they both have the {} as well, and thus
probably
would encounter a problem.
ReproducibleScript:
The AIX 4.3.3 /usr/include/pthread.h file defines PTHREAD_MUTEX_INITIALIZER with a pair of {} already attached (which is needed to delimite the substructure in the PTHREAD_RWLOCK_INITIALIZER define further down). When tclUnixThrd.c uses it with its own {},
the IBM xlc compiler complains about the number of initializers (which is correct - {1,2,3} is different from {{1,2,3}}.
ObservedBehavior:
Failure to compile cleanly
DesiredBehavior:
A correct compile
Patch:
*** unix/tclUnixThrd.c.dist Wed Apr 12 16:47:56 2000
--- unix/tclUnixThrd.c Fri Apr 21 14:30:42 2000
***************
*** 26,32 ****
--- 26,36 ----
* initialize the mutex.
*/
+ #ifdef _AIX
+ static pthread_mutex_t masterLock = PTHREAD_MUTEX_INITIALIZER;
+ #else
static pthread_mutex_t masterLock = {PTHREAD_MUTEX_INITIALIZER};
+ #endif
/*
* initLock is used to serialize initialization and finalization
***************
*** 33,39 ****
--- 37,47 ----
* of Tcl. It cannot use any dyamically allocated storage.
*/
+ #ifdef _AIX
+ static pthread_mutex_t initLock = PTHREAD_MUTEX_INITIALIZER;
+ #else
static pthread_mutex_t initLock = {PTHREAD_MUTEX_INITIALIZER};
+ #endif
/*
* allocLock is used by Tcl's version of malloc for synchronization.
***************
*** 40,46 ****
--- 48,58 ----
* For obvious reasons, cannot use any dyamically allocated storage.
*/
+ #ifdef _AIX
+ static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER;
+ #else
static pthread_mutex_t allocLock = {PTHREAD_MUTEX_INITIALIZER};
+ #endif
static pthread_mutex_t *allocLockPtr = &allocLock;
/*
PatchFiles:
tclUnixThrd.c
Fixed in 8.3.1. Those braces weren't correct for Solaris (x86
and Sparc) or Linux either.
-- 04/25/2000 hobbs
|