summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-06 11:39:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-06 11:39:10 (GMT)
commit814bdc470b9b20e53414976461a9c8bd41651f8d (patch)
tree8135f75806786e5e6311fa6941e6e917c585373f /generic
parentbc79da4cbdd316c54d2a5b1e58de629b1c114ade (diff)
parent468362cf2e909220e77fd0a54484a44cce6f1466 (diff)
downloadtcl-814bdc470b9b20e53414976461a9c8bd41651f8d.zip
tcl-814bdc470b9b20e53414976461a9c8bd41651f8d.tar.gz
tcl-814bdc470b9b20e53414976461a9c8bd41651f8d.tar.bz2
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r--generic/tclLoad.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/generic/tclLoad.c b/generic/tclLoad.c
index 44085d6..bcda420 100644
--- a/generic/tclLoad.c
+++ b/generic/tclLoad.c
@@ -1074,20 +1074,27 @@ TclGetLoadedPackagesEx(
return TCL_OK;
}
+ target = Tcl_GetSlave(interp, targetName);
+ if (target == NULL) {
+ return TCL_ERROR;
+ }
+ ipPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
+
/*
* Return information about all of the available packages.
*/
if (packageName) {
resultObj = NULL;
- Tcl_MutexLock(&packageMutex);
- for (pkgPtr = firstPackagePtr; pkgPtr != NULL;
- pkgPtr = pkgPtr->nextPtr) {
+
+ for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
+ pkgPtr = ipPtr->pkgPtr;
+
if (!strcmp(packageName, pkgPtr->packageName)) {
resultObj = Tcl_NewStringObj(pkgPtr->fileName, -1);
break;
}
}
- Tcl_MutexUnlock(&packageMutex);
+
if (resultObj) {
Tcl_SetObjResult(interp, resultObj);
}
@@ -1099,11 +1106,6 @@ TclGetLoadedPackagesEx(
* interpreter.
*/
- target = Tcl_GetSlave(interp, targetName);
- if (target == NULL) {
- return TCL_ERROR;
- }
- ipPtr = Tcl_GetAssocData(target, "tclLoad", NULL);
resultObj = Tcl_NewObj();
for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) {
pkgPtr = ipPtr->pkgPtr;