mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +02:00
18 lines
315 B
C
18 lines
315 B
C
#include "types.h"
|
|
|
|
u32 atomicIncrement32(u32* p) {
|
|
return __sync_fetch_and_add(p, 1);
|
|
}
|
|
|
|
u32 atomicDecrement32(u32* p) {
|
|
return __sync_sub_and_fetch(p, 1);
|
|
}
|
|
|
|
u64 atomicIncrement64(u64* p) {
|
|
return __sync_fetch_and_add(p, 1);
|
|
}
|
|
|
|
u64 atomicDecrement64(u64* p) {
|
|
return __sync_sub_and_fetch(p, 1);
|
|
}
|