Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TclpFinalizeCondition needs work on win

Closed / Fixed419683ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2001-04-28 01:24:47
The thread extension calls Tcl_ConditionWait in 
ThreadCreate which creates a WinCondition structure 
and pre-inits it's usage.  After the condition 
variable is used, it's removed with 
Tcl_ConditionFinalize.

But Tcl_ConditionFinalize only ckfree's the structure, 
not the contents.  This leaves one undestroyed 
CriticalSection and maybe an event, too.  I'm not sure 
yet.

I'll post a follow-up about this.
davygrvyplain2001-04-28 09:40:00
Logged In: YES 
user_id=7549

This seems to fix it.  I can start and stop threads and the 
application handle count stays steady without growing.

In Tcl_CreateThread, I added a CloseHandle to decrement the 
reference count, so when the thread closes, the resources 
for that handle are reclaimed.

I also added a DeleteCriticalSection for the WinCondition 
structure removed by TclpFinalizeCondition.
davygrvyplain2001-04-28 09:40:01
File Added - 5803: patch.txt
davygrvyplain2001-04-28 10:00:16
Logged In: YES 
user_id=7549

This bug relates to 
https://sourceforge.net/tracker/index.php?
func=detail&aid=406058&group_id=10894&atid=110894 as well.
davygrvyplain2001-04-28 10:14:00
Logged In: YES 
user_id=7549

I'm happy with this patch.  Can I apply it to the core?
davygrvyplain2001-05-18 07:37:13
Logged In: YES 
user_id=7549

Jeff,

Should this get moved over to the patches list for approval?
hobbsplain2001-08-07 06:36:38
Logged In: YES 
user_id=72656

This passed all tests and makes sense, so I've applied it 
to 8.4a3 cvs.
Log in (anonymous is fine) to add a comment.

Attachments: