Skip to content

Instantly share code, notes, and snippets.

@vector4wang
Created May 29, 2019 11:29
Show Gist options
  • Save vector4wang/0ae1314f65c6df333a732aa960e8379a to your computer and use it in GitHub Desktop.
Save vector4wang/0ae1314f65c6df333a732aa960e8379a to your computer and use it in GitHub Desktop.
[Awesome lambda ] #Java #Lambda
ConcurrentHashMap<String, Long> taskCallCountMap = new ConcurrentHashMap<>(8);
taskCallCountMap.merge(this.currentTaskName, 1L, (a, b) -> a + b); // awosome jdk 1.8
// 原子性操作,酷毙了
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment