Skip to content

Instantly share code, notes, and snippets.

View pablomoretti's full-sized avatar

Pablo Moretti pablomoretti

  • MercadoLibre
  • Argentina
View GitHub Profile
@pablomoretti
pablomoretti / LockByName
Created December 22, 2013 20:54
Get lock by name using java.util.concurrent
package com.mercadolibre.concurrent;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
public class LockByName<L> {
ConcurrentHashMap<String, L> mapStringLock;
public LockByName(){