&lock
is used twice, the process does not hang, because
flock is able to recognize that the lock is on the same process. Only
different processes are locked out. Even so, to call &lock
twice is not good programming practice and should not be necesary.