Bug in vxWorks epicsAtomicCmpAndSwapIntT
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Critical
|
Dirk Zimoch |
Bug Description
The usage of epicsAtomicCmpA
vxAtomicLib.html:
vxCas( )
NAME
vxCas( ) - atomically compare-and-swap the contents of a memory location
SYNOPSIS
BOOL vxCas
(
atomic_t * target,
atomicVal_t oldValue,
atomicVal_t newValue
)
DESCRIPTION
This routine performs an atomic compare-and-swap; testing that *target contains oldValue, and if it does, setting the value of *target to newValue.
RETURNS
TRUE if the swap is actually executed, FALSE otherwise.
Comparing this with the gcc documentation:
bool __sync_
type __sync_
These builtins perform an atomic compare and swap. That is, if the current value of *ptr is oldval, then write newval into *ptr.
The “bool” version returns true if the comparison is successful and newval was written.
The “val” version returns the contents of *ptr before the operation.
That means epicsAtomicCmpA
But the usage implies an expected bahavior like __sync_
This bugs prevents the callback threads from being started in vxWorks 6.7, maybe more or all vxWorks 6 versions.
Changed in epics-base: | |
milestone: | none → 7.0.6 |
Changed in epics-base: | |
status: | In Progress → Fix Committed |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
This patch makes vxWorks use the generic version of epicsAtomicCmpA ndSwapIntT( ) instead of using vxCas().