• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • ehcache-terracotta
  • alexsnaps
  • Reporter: alexsnaps
  • June 02, 2010
  • 0
  • Watchers: 0
  • July 15, 2010
  • June 20, 2010

Description

http://forums.terracotta.org/forums/posts/list/3717.page

Comments

Alexander Snaps 2010-06-02

Did a quick fix in Ehcache’s Cache.tryRemoveImmediately() with r2491 But the fix should probably go in tim-ehcache’s TcSync.tryLock, where that should mimic the JDK’s behavior and do something like :

    boolean locked = false;
    if (!lock.isHeldByCurrentThread(org.terracotta.collections.LockType.READ)) {
      locked = lock.tryLock(org.terracotta.collections.LockType.WRITE, timeout, TimeUnit.MILLISECONDS);
    } else {
      Thread.sleep(timeout);
    }
    return locked;

Thoughts ?

Alexander Snaps 2010-06-20

Fixed on terracotta-toolkit’s trunk