aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/atomic-2.C
blob: ac363eb16dac12b8174f3216da7bc6a43be8b88d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR c++/57926

long Mutex[1];

int AcquireLogMutex(void)
{
  return __atomic_exchange_n(Mutex, 1, __ATOMIC_SEQ_CST);
}

void ReleaseLogMutex(void)
{
  long i = 0;
  __atomic_store(Mutex, &i, __ATOMIC_SEQ_CST);
}