MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / atomicMax

Function atomicMax

physx/source/foundation/src/unix/PsUnixAtomic.cpp:68–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68int32_t atomicMax(volatile int32_t* val, int32_t val2)
69{
70 int32_t oldVal, newVal;
71
72 do
73 {
74 PAUSE();
75 oldVal = *val;
76
77 if(val2 > oldVal)
78 newVal = val2;
79 else
80 newVal = oldVal;
81
82 } while(atomicCompareExchange(val, newVal, oldVal) != oldVal);
83
84 return *val;
85}
86
87int32_t atomicExchange(volatile int32_t* val, int32_t val2)
88{

Callers 5

runInternalMethod · 0.50
runInternalMethod · 0.50
runInternalMethod · 0.50
runInternalMethod · 0.50

Calls 1

atomicCompareExchangeFunction · 0.70

Tested by

no test coverage detected