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

6
LINES

< > BotCompany Repo | #1036508 // syncFirst - first + synchronize

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

Libraryless. Click here for Pure Java version (9938L/55K).

static <A> A syncFirst(Iterable<A> l) {
  if (l == null) null;
  synchronized(collectionMutex(l)) {
    ret first(l);
  }
}

Author comment

Began life as a copy of #1025950

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1036508
Snippet name: syncFirst - first + synchronize
Eternal ID of this version: #1036508/3
Text MD5: 039379479556a087473764403dd337b9
Transpilation MD5: fd560511b22eb30a623a7267bfa2c74e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-01-17 22:58:26
Source code size: 130 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 208
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)