Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: libCom posix/Linux
From: Heinz Junkes <junkes@fhi-berlin.mpg.de>
To: core-talk@aps.anl.gov
Date: Fri, 14 Jul 2017 08:45:15 +0200
A “new” epicsShareFunc has been added in 3.16 ( maybe already in 3.15 ) to posix/osdThread.c

epicsShareFunc int epicsThreadGetPosixPriority(epicsThreadId pthreadInfo)
{
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
    double maxPriority,minPriority,slope,oss;

    if(pcommonAttr->maxPriority==pcommonAttr->minPriority)
        return(pcommonAttr->maxPriority);
    maxPriority = (double)pcommonAttr->maxPriority;
    minPriority = (double)pcommonAttr->minPriority;
    slope = (maxPriority - minPriority)/100.0;
    oss = (double)pthreadInfo->osiPriority * slope + minPriority;
    return((int)oss);
#else
    return 0;
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
}

The function is declared here

src/libCom/osi/os/Linux/osdThread.h:epicsShareFunc int epicsThreadGetPosixPriority(epicsThreadId id);
src/libCom/osi/os/posix/osdThread.h:epicsShareFunc int epicsThreadGetPosixPriority(epicsThreadId id);


The function is not called elsewhere but in osdThread.c itself.
Why not static to this file?

There is no “guard” in the function like in other similiar functions like

e.g.    assert(epicsThreadOnceCalled);


Heinz



Attachment: smime.p7s
Description: S/MIME cryptographic signature


Replies:
Re: libCom posix/Linux Michael Davidsaver

Navigate by Date:
Prev: Re: libcom tests Michael Davidsaver
Next: Re: libCom posix/Linux Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: libcom tests Michael Davidsaver
Next: Re: libCom posix/Linux Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 14 Jul 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·