Tcl package Thread source code

Check-in [25990db353]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Free the mutex prior to returning from ThreadFreeError.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | finalize
Files: files | file ages | folders
SHA1: 25990db3530fd800947cdff766689b21cbf4a06b
User & Date: mistachkin 2011-10-12 07:07:27
Context
2012-04-23
20:31
Backport bug fixes check-in: 695182249f user: dgp tags: thread-2-6-branch
2011-11-01
15:07
Merge in bug fixes and finalization support check-in: 6067508840 user: dgp tags: trunk
2011-10-12
07:07
Free the mutex prior to returning from ThreadFreeError. Closed-Leaf check-in: 25990db353 user: mistachkin tags: finalize
2011-09-23
14:16
Stop leaking the errorProcString check-in: 4e5eaeef0c user: dgp tags: finalize
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/threadCmd.c.

1112
1113
1114
1115
1116
1117
1118

1119
1120
1121
1122
1123
1124
1125
 
static void
ThreadFreeError(clientData)
    ClientData clientData;
{
    Tcl_MutexLock(&threadMutex);
    if (errorThreadId != Tcl_GetCurrentThread()) {

	return;
    }
    Tcl_Free(errorProcString);
    errorThreadId = NULL;
    errorProcString = NULL;
    Tcl_MutexUnlock(&threadMutex);
}






>







1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
 
static void
ThreadFreeError(clientData)
    ClientData clientData;
{
    Tcl_MutexLock(&threadMutex);
    if (errorThreadId != Tcl_GetCurrentThread()) {
	Tcl_MutexUnlock(&threadMutex);
	return;
    }
    Tcl_Free(errorProcString);
    errorThreadId = NULL;
    errorProcString = NULL;
    Tcl_MutexUnlock(&threadMutex);
}