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

11
LINES

< > BotCompany Repo | #1018971 // syncIncIntVar

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2304L/15K).

1  
static Int syncIncIntVar(Var<Int> v, int i) {
2  
  if (v == null) null;
3  
  synchronized(v) {
4  
    v.set(or0(v!)+i);
5  
    ret v!;
6  
  }
7  
}
8  
9  
static Int syncIncIntVar(Var<Int> v) {
10  
  ret syncIncIntVar(v, 1);
11  
}

Author comment

Began life as a copy of #1016546

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1018971
Snippet name: syncIncIntVar
Eternal ID of this version: #1018971/5
Text MD5: b8e7a7ee332ff9175c894499c12acc4b
Transpilation MD5: eff99f21a68ad56f72e505d51b58d671
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-20 15:49:05
Source code size: 207 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 309 / 401
Version history: 4 change(s)
Referenced in: [show references]