destroy semaphore when no other process is waitng

for PrepLineObjects