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

10
LINES

< > BotCompany Repo | #1025952 // syncTakeLast function - takeLast + synchronize

JavaX fragment (include)

static <A> L<A> syncTakeLast(L<A> l, int n) {
  if (l == null) ret takeLast(l, n);
  synchronized(collectionMutex(l)) {
    ret takeLast(l, n);
  }
}

static <A> L<A> syncTakeLast(int n, L<A> l) {
  ret syncTakeLast(l, n);
}

Author comment

Began life as a copy of #1025950

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025952
Snippet name: syncTakeLast function - takeLast + synchronize
Eternal ID of this version: #1025952/1
Text MD5: 79086eef59ff6acef26c61ec633f1111
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-02 12:21:31
Source code size: 233 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 191 / 224
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)