Libraryless. Click here for Pure Java version (2806L/16K).
static int syncL(Cl l) { if (l == null) ret 0; synchronized(collectionMutex(l)) { ret l.size(); } } static int syncL(Map map) { if (map == null) ret 0; synchronized(collectionMutex(map)) { ret map.size(); } } static <A> L<A> syncL() { ret syncList(); }
Began life as a copy of #1012674
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1020733 |
| Snippet name: | syncL - get size of collection or map while synchronizing on it. also, make a synchronized ArrayList |
| Eternal ID of this version: | #1020733/7 |
| Text MD5: | 6bacc04bbda0fd1f580239b4432894c3 |
| Transpilation MD5: | c25997e68799de06492e34d9b1cc1fea |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-06-17 07:24:04 |
| Source code size: | 276 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 734 / 964 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |