I like FlockMutex because it work on kernel level and is reliable.
however there's the problem that acquiring the lock makes program wait forever. I wish to get error "unable to obtain lock withing timeout"
for flock there's LOCK_NB flag which can be used.
ps: SemaphoreMutex has similar issue