>Why not simply using flock() to determine if one process has acquired the lock?

Didn't delved into it deeply but it seems it won't work for MS Windows. Even if we'll create lock file, how non-blocking lock detection can be performed? `flock(LOCK_EX | LOCK_NB)` is not available for MS Windows.