cvmfs/cvmfs — pull request #101 by reneme (2013-02-25 17:17:04+00:00)
Title: FIX: Race Condition in FileProcessor

Due to a race condition the FileProcessor occasionally produced a heap corruption, leading to a segmentation fault while publishing a repository.

After a PendingFile is successfully processed and uploaded, the worker thread pushes it into a garbage queue for later deletion. Following this push operation the PendingFile was unlocked by a LockGuard running out of scope.
The race condition occurred, when the garbage queue was emptied by another thread BEFORE this unlock has happened, resulting in a heap corruption when unlocking the already destroyed mutex.

That was nasty! Thanks valgrind!