O/S semaphores help!!

Can anyone tell me what is the difference between these to semaphore
codes??
To me they do the same thing!!!
More confusingly i can't seem to figure out what the sencond
signal(mutex)<<right after wait(delay)>> in second code is doing !!
I do appreciate any help from anyone out there.

mutex = 1, delay = 0 , count = 0

proc p=                                 proc v=
wait(mutex)                             wait(mutex)
count -1                                count +1
if count <0 then                     if count<=0
   singnal(mutex)                          signal(delay)
   wait(delay)                          fin
else                                    signal(mutex)
   signalc(mutex)
fin

proc p=                                 proc v=
wait(mutex)                             wait(mutex)
count -1                                count +1
if count <0 then                     if count<=0
   singnal(mutex)                          signal(delay)
   wait(delay)                          else
   signal(mutex)
else                                       signal(mutex)
   signal(mutex)
fin                                     fin

r_ma...@alcor.concordia.ca