1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 <2009> 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 <2009> 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | 2 cents of pedantry |
From: | Till Straumann <[email protected]> |
To: | EPICS Techtalk <[email protected]> |
Date: | Fri, 21 Aug 2009 11:37:09 -0500 |
Browsing epics-3.14.10 I came across a typical lazy-init which is obviously not thread-safe: from libCom/osi/os/default/osdInterrupt.c: static epicsMutexId globalLock=0; static int firstTime = 1; epicsShareFunc int epicsShareAPI epicsInterruptLock() { if(firstTime) { globalLock = epicsMutexMustCreate(); firstTime = 0; } epicsMutexMustLock(globalLock); return(0); } I see this kind of code quite often (and must admit that I have committed this sort of error myself...) FWIW -- Till