Wait until flag=true

I have javascript function like this:

function myFunction(number) {

    var x=number;
    ...
    ... more initializations
    //here need to wait until flag==true
    while(flag==false)
    {}

    ...
    ... do something

}

The problem is that the javascript is stuck in the while and stuck my program. so my question is how can I wait in the middle of the function until flag is true without “busy-wait”?

132 thoughts on “Wait until flag=true”

  1. Pingback: buy generic viagra
  2. Pingback: womens viagra
  3. Pingback: tab cialis 20mg
  4. Pingback: female viagra
  5. Pingback: cheap viagra
  6. Pingback: viagra
  7. Pingback: sildenafil online
  8. Pingback: sildenafil coupon
  9. Pingback: cialis generic
  10. Pingback: sildenafil 20mg
  11. Pingback: viagra connect
  12. Pingback: viagra alternative
  13. Pingback: viagra pills
  14. Pingback: viagra bestellen
  15. Pingback: price for viagra
  16. Pingback: female viagra pill
  17. Pingback: what is viagra
  18. Pingback: viagra online
  19. Pingback: buy viagra online
  20. Pingback: viagra price
  21. Pingback: cost of viagra
  22. Pingback: viagra cost
  23. Pingback: brand cialis

Leave a Comment