To make flock non blocking you have to use the LOCK_NB flag.
In reply to Re^2: Fork + Flock = Who Gets the Lock? by salva in thread Fork + Flock = Who Gets the Lock? by Anonymous Monk