How memory barrier act in multithread enviroment with one core?

I try to use barrier test with multithread enviroment, and I find it's interesting that it act like single thread. A single code is like:

#define barrier() __asm__ __volatile__("": : :"memory")

int count;

static __inline__ void run_on(int cpu){
  cpu_set_t mask;
  CPU_ZERO(&mask);
  CPU_SET(cpu, &mask);
  sched_setaffinity(0, sizeof(mask), &mask);
}

void add(){
  run_on(0);
  for(int i = 0; i < 1000; i++){
    count++;
    barrier();
  }
}

int main(){
  std::thread t[10];
  for (int i = 0; i < 10; i++){
    t[i] = std::thread([=](){add();});
  }

  for (int i = 0; i < 10; i++)
    t[i].join();

  printf("%d\n", count);
}

the final output is always 10000. Is it because barrier?