1 | static <A> bool waitForVarToChange_withTimeout(Var<A> v, A knownValue, long timeout) ctex { |
2 | synchronized(v) { |
3 | long destTime = sysNow()+timeout, remainingTime; |
4 | while ((remainingTime = destTime-sysNow()) > 0) { |
5 | if (neq(knownValue, v!)) true; |
6 | v.wait(remainingTime); |
7 | } |
8 | false; |
9 | } |
10 | } |
Began life as a copy of #1016545
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016547 |
Snippet name: | waitForVarToChange_withTimeout - returns true if there was a change |
Eternal ID of this version: | #1016547/5 |
Text MD5: | 6e40f60f8274ec250a2b351eb4569494 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-23 14:42:04 |
Source code size: | 320 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 428 / 473 |
Version history: | 4 change(s) |
Referenced in: | [show references] |