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

4
LINES

< > BotCompany Repo | #1019133 // syncPut - put & synchronize on map

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

Libraryless. Click here for Pure Java version (29L/1K).

static <A, B> B syncPut(Map<A, B> map, A key, B value) {
  if (map == null) null;
  synchronized(map) { ret map.put(key, value); }
}

Author comment

Began life as a copy of #1016979

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019133
Snippet name: syncPut - put & synchronize on map
Eternal ID of this version: #1019133/3
Text MD5: ad81d89122c95994f267f3306f46c8ba
Transpilation MD5: 778212c8632683e2bdaddcc34e5d39c4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-08 15:19:53
Source code size: 135 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 258 / 336
Version history: 2 change(s)
Referenced in: [show references]