How to make functions in PHP synchronized so that same function won\'t be executed concurrently ? 2nd user must wait till 1st user is done with the function. Then 2nd user
Bear in mind that using a semaphore (or any other blocking mechanism) can have serious peformance issues, as the requests can not be handled while the semaphore is up.