What happens when two semaphores change simultaneously and one of the two cannot decrement immediately?

前端 未结 0 1338
耶瑟儿~
耶瑟儿~ 2020-12-29 17:16

Consider this code:

struct sembuf s_op[2];

s_op[0].sem_num = old;
s_op[0].sem_op = 1;
s_op[0].sem_flg = 0;
s_op[1].sem_num = new;
s_op[1].sem_op = -1;
s_op[1         


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