generator: Acquire lock to prevent two parallel runs of the generator.
authorRichard Jones <rjones@redhat.com>
Thu, 19 Nov 2009 13:48:59 +0000 (13:48 +0000)
committerRichard Jones <rjones@redhat.com>
Thu, 19 Nov 2009 14:03:59 +0000 (14:03 +0000)
commit16c1b3164698900f52294e1396542ddd94a4cae4
treeaec544f264ef593118b28a8c082cadb4426cb708
parent60d020d363ec49a547fe047ac2f9bd88c8efcd5c
generator: Acquire lock to prevent two parallel runs of the generator.

This commit acquires a lock on a file to prevent two parallel runs of
the generator from stomping on each other.  The second run will wait
for the first to complete before starting.

The lock is acquired on the "HACKING" file because it's convenient --
we are already checking this file exists to make sure that we don't
start off in the wrong directory.

Tested by adding some artificial sleeps in the code to observe
locking behaviour between two parallel runs.
src/generator.ml [changed mode: 0644->0755]