In case of TSL we are aware of the following instructions:
1. TSL LOCK, Ro
2. CMP Ro, #0
3. JNZ step1
Now, the initial value of LOCK is 0
If process Po comes and executes line 1 and if it gets preempted, then Ro = 0 and LOCK = 1
Now, If process P1 comes and executes line 1, then it will store the value of LOCK variable(i.e 1) in Ro and set LOCK as 1...right?
Now, suppose P1 gets preempted and Po comes back execute line 2. Now, the value of Ro is set as 1(as P1 made it to 1) and Po should not be able to enter the CS...right?
So, in this way, Po and P1 both will get stuck...right? and so is there a chance of deadlock?