Improve compatibility checks in WaitConditionLoop
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 12 Sep 2016 09:47:06 +0000 (02:47 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 12 Sep 2016 09:50:27 +0000 (09:50 +0000)
commit6131a6d11b814eed96a42888d68efff5ff0d44cd
tree6ae322accef8814740975edc6eefa7bb3f7375ba
parent3979e37fcfa62e6d7282b58774a7e17a27fc36e1
Improve compatibility checks in WaitConditionLoop

* Check if getrusage() is not defined.
* Assume worse-case CPU usage in such cases to avoid spin loops.
* Move these checks to the constructor so they only happen once.

Change-Id: I180629c17b3323e8841a25c2d920390116ae6b74
includes/libs/WaitConditionLoop.php