简体   繁体   中英

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:

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:

  • Before 1.1
  • Between 1.3 and 1.5
  • After 1.7

The values of x and y for these three cases are

  • x = 11, y = 25
  • x = 11, y = 5
  • x = 15, y = 5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM