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
- Replies:
- Re: 2 cents of pedantry Andrew Johnson
- Navigate by Date:
- Prev:
EPICS Base R3.14.11-RC1 Available Andrew Johnson
- Next:
Re: 2 cents of pedantry Andrew Johnson
- 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
- Navigate by Thread:
- Prev:
EPICS Base R3.14.11-RC1 Available Andrew Johnson
- Next:
Re: 2 cents of pedantry Andrew Johnson
- 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
|