Use the common atomic operations when needed. Signed-off-by: Matheus Castello <matheus@castello.eng.br>