compare and swap

Hi all, I am looking for the function “compare-and-swap(CAS)”, but I cannot find any information about it. Does QNX provide it? If not, would you tell me how to implement it on QNX?

Thank you so much.

Yes, it’s called _smp_cmpxchg() defined in /usr/include//cmpxchg.h

int _smp_cmpxchg(volatile unsigned *__dst, unsigned __cmp, unsigned __new);