non-atomic operations on atomic variables and vice versa

前端 未结 0 1800
生来不讨喜
生来不讨喜 2021-02-05 23:09

Given the below code:

static int x;

static void f() {
  for (int i = 0; i < 100; ++i)
    atomic_fetch_add(&x, 3);
}

Further, assume that

相关标签:
回答
  • 消灭零回复
提交回复
热议问题