The documentation say :

  LOCK_EX 

     Exclusive lock. Only one process may hold an exclusive lock for a
                     ^^^^^^^^^^^^^^^^
     given file at a given time.

 This is "Only one thread", no ?


Guy Decoux