Skip to content
Tcl Source Code Artifact [29339bf68e]
Login

Artifact [29339bf68e]

Artifact 29339bf68e2ffdc47c4e1a90a043bcd015f2c2a9:

Ticket change [29339bf68e] - New ticket [992108ffffffffff|992108ffff] <i>TclpFinalizeLock on Unix not correct.</i>. by mistachkin on 2004-07-16 03:52:25.
D 2004-07-16T03:52:25
J assignee andreas_kupries
J cmimetype text/plain
J comment \nThe\sfunction\scurrently\sreads:\n\nvoid\nTclFinalizeLock\s()\n{\n#ifdef\sTCL_THREADS\n\s\s\s\s/*\n\s\s\s\s\s*\sYou\sdo\snot\sneed\sto\sdestroy\smutexes\sthat\swere\ncreated\swith\sthe\n\s\s\s\s\s*\sPTHREAD_MUTEX_INITIALIZER\smacro.\s\sThese\smutexes\ndo\snot\sneed\n\s\s\s\s\s*\sany\sdestruction:\smasterLock,\sallocLock,\sand\ninitLock.\n\s\s\s\s\s*/\n\s\s\s\spthread_mutex_unlock(&initLock);\n#endif\n}\n\nI\sbelieve\sthat\sboth\sthe\scomment\sand\sthe\scode\sare\nincorrect.\s\sMutexes\screated\swith\sthe\spthread\slibrary\nhave\smemory\sassociated\swith\sthem\sinternally\swhen\syou\ncall\spthread_mutex_create,\stherefore,\npthread_mutex_destroy\smust\sbe\scalled\son\sthem.\s\sIn\smy\nopinion,\sthe\sfunction\sshould\sbe\smore\slike\sthis:\n\nTclFinalizeLock\s()\n{\n#ifdef\sTCL_THREADS\n\s\s\s\s/*\n\s\s\s\s\s*\sThese\smutexes\sneed\sto\sbe\sdestroyed\svia\npthread_mutex_destroy\s\n\s\s\s\s\s*\sbecause\sthey\swere\screated\swith\npthread_mutex_create,\swhich\s\n\s\s\s\s\s*\sinternally\sallocates\smemory\son\ssome\splatforms.\n\s\s\s\s\s*/\n\s\s\s\spthread_mutex_destroy(&allocLock);\n\s\s\s\spthread_mutex_destroy(&masterLock);\n\s\s\s\spthread_mutex_unlock(&initLock);\n\s\s\s\spthread_mutex_destroy(&initLock);\n#endif\n}\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter mistachkin
J subsystem 49.\sThreading
J title TclpFinalizeLock\son\sUnix\snot\scorrect.
J type Bug
K 992108ffffffffffffffffffffffffffffffffff
U mistachkin
Z 4fc92e5af963c9425f0f39638cdc4dd8