Clean up unique lock files on signal and always release the lock
authorBen Langmuir <blangmuir@apple.com>
Mon, 29 Jun 2015 17:08:41 +0000 (17:08 +0000)
committerBen Langmuir <blangmuir@apple.com>
Mon, 29 Jun 2015 17:08:41 +0000 (17:08 +0000)
commit63aa8c5d282e7725d2e33203abd099f7d128ef9d
treed91935cd35cd3fe2359b31558c4a6060d0abc34f
parent8f6f4285f3aa4fdcbbb378e9e399326232c0645a
Clean up unique lock files on signal and always release the lock

Make sure to remove the unique lock file, which is what the .lock
symlink points to, if there is a signal while the lock is held. This
will release the lock, since the symlink will point to nothing (already
tested in unit tests). For good measure, also clean up the unique lock
file if there is an error or signal before the lock is acquired.

I will add a clang test.

rdar://problem/21512307

llvm-svn: 240967
llvm/lib/Support/LockFileManager.cpp