Warning: session_start(): open(/var/lib/php/sessions/sess_4fhcg9gkcp70q6803iq4bd5me9, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
syncTakeLast function - takeLast + synchronize [1025952]

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: 608 / 619
Referenced in: [show references]