Safely modifying variable in two threads

前端 未结 0 1668
谎友^
谎友^ 2020-12-05 22:58

Consider the following contrived examples-

Say I have a thread that modifies a global variable:

void thread_1() {
    for (int i=0; i<10; i++) {
            


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