# alg_dead1.py
#
# Deadlock by waiting on the same semaphore twice

# We want all the symbols from sim161
from sim161 import *

def main( args ):

    # Setup our semaphore
    sem = sem_create( "sem0", 1 )
    
    # Acquire the semaphore
    P( sem )

    # And again, while we still hold it
    P( sem )
    
