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

7
LINES

< > BotCompany Repo | #1016980 - syncClear - clear & synchronize on collection

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

Libraryless. Click here for Pure Java version (2496L/16K).

static <A> void syncClear(Collection<A> c) {
  if (c != null) synchronized(collectionMutex(c)) { c.clear(); }
}

svoid syncClear(Map map) {
  if (map != null) synchronized(collectionMutex(map)) { map.clear(); }
}

Author comment

Began life as a copy of #1016979

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1016980
Snippet name: syncClear - clear & synchronize on collection
Eternal ID of this version: #1016980/4
Text MD5: 6a0a028e55b66f7230eb152d22087858
Transpilation MD5: 349571e8ae45f2a13e55d12b53908ba4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-11 15:47:53
Source code size: 218 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 143 / 145
Version history: 3 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1016980 & http://1016980.tinybrain.de