Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1022972 // setVar_trueIfChanged - synchronized

JavaX fragment (include)

static <A> bool setVar_trueIfChanged(IVar<A> v, A value) {
  if (v == null) false;
  synchronized(v) {
    if (eq(v!, value)) false;
    v.set(value);
    true;
  }
}

Author comment

Began life as a copy of #1016371

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022972
Snippet name: setVar_trueIfChanged - synchronized
Eternal ID of this version: #1022972/3
Text MD5: 4ac57fc5dfd7533cb6404a263562532b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-22 01:38:54
Source code size: 173 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 296 / 395
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)