#ifndef RTG_ATOMIC_H_
#define RTG_ATOMIC_H_

extern "C"
{
  typedef long rtg_atom_value_t;
  typedef volatile rtg_atom_value_t rtg_atom_t;

  extern rtg_atom_value_t rtg_atomic_increment(rtg_atom_t* const);
  extern rtg_atom_value_t rtg_atomic_decrement(rtg_atom_t* const);

  extern rtg_atom_value_t rtg_atomic_exchange(rtg_atom_t* const, rtg_atom_t);

}

/*
__inline rtg_atom_t rtg_atomic_increment(rtg_atom_t *const p)
{
  __asm("inc %0");
}
*/

#endif /*RTG_INSTRINSIC_H_*/
