
; Sense Reversing Barrier (single entry)

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

begin thread_data
    X  dd  0
end thread_data

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

begin init_code
    start_threads
end init_code

begin unsafe_prop
  eip[$t1] = entr && eip[$t2] = done
end unsafe_prop
