
; Sense Reversing Barrier (multiple entries)

begin shared_data
    sense  dd  0
    count  dd  N ! as counter
end shared_data

begin thread_code
      mov esi, 0 ; esi = local_sense = 0
loop: not esi
      lock dec dword [count]
      jne spin
last: mov dword [count], N
      mov dword [sense], esi
      jmp loop
spin: cmp dword [sense], esi	
      jne spin
      jmp loop
end thread_code

begin init_code
    start_threads
end init_code

begin unsafe_prop
  eip[$t1] = loop && eip[$t2] = loop && esi[$t1] <> esi[$t2]
end unsafe_prop
