Libraryless. Click here for Pure Java version (5020L/28K).
sclass IntVar { int a; // you can access this directly if you use one thread public synchronized void set(int v) { if (v != a) { a = v; notifyAll(); } } public synchronized int get() { ret a; } synchronized int waitForValue(int x) ctex { while (a != x) wait(); ret a; } toString { ret str(this!); } }
Began life as a copy of #1033321
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033409 |
Snippet name: | IntVar (never null!) |
Eternal ID of this version: | #1033409/4 |
Text MD5: | b6b0724f8efb0f17cab81a7aba9d4621 |
Transpilation MD5: | d9de488556271b2ffe180ae021da85c6 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-19 05:45:26 |
Source code size: | 370 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 235 / 340 |
Version history: | 3 change(s) |
Referenced in: | #1033721 - WeakVar - Var using a weak reference #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674) #1034582 - DoubleVar (never null, stores primitive value, primitive method signatures) |