A Semaphore with a maximum count of 1 is functionally the same as a mutex (sometimes called a binary semaphore). Of course you can use a mutex instead, is this on Windows?
Nowhere in your post did you mention that a remote machine is involved. In that case a Mutex or Semaphore is not appropriate (I'm not so sure that file locking would be either). Other options include named pipes, but this then depends on the operating system.