Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: caGateway crashes / use of *MustSucceed functions
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: <tech-talk@aps.anl.gov>
Date: Wed, 18 May 2011 17:36:21 +0200
Am Mittwoch, 18. Mai 2011, um 16:54:46 schrieb J. Lewis Muir:
> On 5/18/11 7:21 AM, Dirk Zimoch wrote:
> > Therefore I propose to remove all *MustSucceed functions from
> > future EPICS releases and allow and require proper error
> > handling by the application.
> >
> > Any opinions on this topic?
>
> Hi, Dirk.
>
> What about the *MustCreate, *MustWait, and *MustLock functions?

In 3.14.12 these are all ok:

>   epicsEventMustCreate

Implemented for all platforms as

epicsEventId epicsEventMustCreate(epicsEventInitialState initialState)
{
    epicsEventId id = epicsEventCreate (initialState);
    assert (id);
    return id;
}

>   epicsEventMustWait

#define epicsEventMustWait(ID) {                        \
    epicsEventWaitStatus status = epicsEventWait(ID);   \
    assert(status == epicsEventWaitOK);                 \
}

>   epicsMutexMustCreate

#define epicsMutexMustCreate() epicsMutexOsiMustCreate(__FILE__,__LINE__)

Implemented for all platforms as

epicsMutexId epicsShareAPI epicsMutexOsiMustCreate(
    const char *pFileName,int lineno)
{
    epicsMutexId id = epicsMutexOsiCreate(pFileName,lineno);
    assert(id);
    return(id );
}

>   epicsMutexMustLock

 #define epicsEventMustWait(ID) {                        \
    epicsEventWaitStatus status = epicsEventWait(ID);   \
    assert(status == epicsEventWaitOK);                 \
}

>   epicsThreadMustCreate

Implemented for all platforms as

epicsThreadId
threadMustCreate (const char *name,
    unsigned int priority, unsigned int stackSize,
    EPICSTHREADFUNC funptr,void *parm)
{
    epicsThreadId tid;

    if ((tid = epicsThreadCreate (name, priority, stackSize, funptr, parm)) ==
NULL)
        cantProceed (0);
    return tid;
}

> On a related note, I didn't look at all of them, but some of
> these (e.g. epicsEventMustWait) are implemented as macros that
> just do an assert on the return status of the regular non-must
> function.  Others (e.g. POSIX epicsEventMustCreate) are actual
> functions, but they too just do an assert.  If assertions are
> disabled, this will do nothing and hence seems broken to me.  No?

See above. Maybe you have been looking at an older relese?

Cheers
Ben

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c. Wolfgang Eberhardt, Dr. Ulrich Breuer

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de


Replies:
Re: caGateway crashes / use of *MustSucceed functions Benjamin Franksen
Re: caGateway crashes / use of *MustSucceed functions J. Lewis Muir
References:
caGateway crashes / use of *MustSucceed functions Dirk Zimoch
Re: caGateway crashes / use of *MustSucceed functions J. Lewis Muir

Navigate by Date:
Prev: Re: caGateway crashes / use of *MustSucceed functions Dirk Zimoch
Next: Re: caGateway crashes / use of *MustSucceed functions Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: caGateway crashes / use of *MustSucceed functions Benjamin Franksen
Next: Re: caGateway crashes / use of *MustSucceed functions Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·