OSDN Git Service

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)
commit4081538b2e3282b104c911b2fdf8ef65e47df122
tree4fc1408756d3013494448e4f76206eea9a3e52ba
parent1a4def3d97f3dbec286e875c9c239709fe1f24a0
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240967 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/LockFileManager.cpp