[英]Reentrant Lock - possible outputs?
given lock situation: 给定锁定情况:
I think I got this right but I need to be sure so I'm asking you guys if I made a mistake. 我想我没错,但是我需要确定,所以我问你们是否犯错了。
I got two possible outputs for variables "x" and "y" in this programm: 在此程序中,变量“ x”和“ y”有两个可能的输出:
1. Lines 1.1 - 1.7: y = 5,
Lines 2.1 - 2.3: x = 15.
2. Lines 2.1 - 2.3: x = 11,
rest y = 25.
are there any other outputs in this exact situation? 在这种确切情况下还有其他输出吗?
The lock block on the right had side can occur in one of three places: 右侧锁块可以在以下三个位置之一发生:
The values of x
and y
for these three cases are 这三种情况下的x
和y
的值为
x = 11, y = 25
x = 11, y = 5
x = 15, y = 5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.