multiple instance of same object running in multithread, how do i prevent to change a global variable by all threads?

前端 未结 0 1234
轮回少年
轮回少年 2020-12-29 03:34

I have a class named myConsumer and it has a function getDataFromBuffer(). I create multiple instance of the object consumer1, consumer2, consumer3 from my class. Each consu

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