RTEMS epicsThreadOnce() uses epicsMutex API

Bug #1542539 reported by Andrew Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Low
mdavidsaver

Bug Description

The RTEMS implementation of epicsThreadOnce() uses an epicsMutex in its implementation. None of the other implementations do so, they all use native primitives internally. I would like to replace the
    static int firstTime = 1;
variable in the libCom/osi/epicsMutex.cpp source file with an epicsThreadOnceId, but on RTEMS I believe this would result in the following initialization loop, triggered the first time any epicsThread routine is called:
    epicsThreadInit() => epicsMutexMustCreate() => epicsMutexOsiMustCreate() => epicsThreadOnce() => epicsThreadInit()

The patch I want to apply is attached, but it could only be committed after this bug has been fixed.

Tags: rtems
Revision history for this message
Andrew Johnson (anj) wrote :
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

I suspect you're right about the loop. And in any event, I agree that use of epicsMutex is inappropriate here.

Changed in epics-base:
status: New → Triaged
assignee: nobody → mdavidsaver (mdavidsaver)
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Update of Andrew's previous not-a-fix after recent merges

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

With Andrew's patch, avoids recursive epicsThreadInit() call (which does happen w/o it).

Andrew Johnson (anj)
Changed in epics-base:
status: Triaged → Fix Committed
Andrew Johnson (anj)
Changed in epics-base:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.