<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"/*EC*/-->
<html><head><title></title><style type="text/css"><!-- body{padding:1ex;margin:0;font-family:sans-serif;font-size:small}a[href]{color:-moz-hyperlinktext!important;text-decoration:-moz-anchor-decoration}blockquote{margin:0;border-left:2px solid #144fae;padding-left:1em}blockquote blockquote{border-color:#006312}blockquote blockquote blockquote{border-color:#540000} --></style></head><body><div style="font-family: Arial; font-size: medium;" dir="ltr"><div>
Hit send too soon ...</div>
<div>
</div>
<div>
I'm reviewing a lot of code that has thread acquire and release locks scattered throughout the code base.</div>
<div class="defangedMessage">
<div id="me97749">
<div dir="ltr" style="font-family: arial; font-size: medium;">
<div>
</div>
<div>
Would a better technique be to use contextmanagers (for safe granular locking within a function) or decorators (function wide locks) to manage locks or am I making things too complicated?</div>
<div>
</div>
<div>
Am I reinventing the wheel by creating my own versions of above or are there off-the-shelf, debugged versions of above that one can use?</div>
<div>
</div>
<div>
Thank you,</div>
<div>
Malcolm</div>
</div>
</div>
</div>
</div></body></html>