I tried to use sleep and tried to approach but it sometimes fails what is the standard? Nothing can get clear around, thanks.
With this approach testFoo () never returns sometimes. I suspect any deadlock.
By the way php scopes variable, you are not changing the same $ semaphore
variable in your test You can change the foo (...)
.
are creating a new variable in the anonymous method, you will need to mark var with the usage
> keyword.
function testFoo () {$ semaphore = 1; Use FU (function () ($ semaphore) {$ semaphore = 0;}); $ This- & gt; Emphasis value (0, $ semaphore); }
There is no need for sleep, as we can see from here. More information will be needed on $ bar-> asynCall ()
. See more on the variable scope here:
No comments:
Post a Comment