title: Coherence lock-unlock usage
body: <p>I have a test sample about coherence lock-unlock mechanism like this:</p>
  
  <pre><code>public class Test {
  
  
      public static void main(String[] args) throws InterruptedException, IOException, IllegalArgumentException, IllegalAccessException {
  
          Trt test=new Trt();
          test.lock();
          Thread a=new Thread(test);
          a.start();
      }
  
      public static class Trt implements Runnable{
  
          NamedCache cache=null;
  
          @Override
          public void run() {
  
              System.out.println(cache.unlock("asd"));
  
  
          }
  
          public void lock(){
              cache= CacheFactory.getCache(Globals.REGISTRY_CACHE_NAME);
  
              System.out.println(cache.lock("asd"));
  
          }
  
      }
  }
  </code></pre>
  
  <p>So the result is:</p>
  
  <pre><code>true
  false
  </code></pre>
  
  <p>The result that I am expecting is:</p>
  
  <pre><code>true
  true
  </code></pre>
  
  <p>But the case is, I have only one item 'test', I am all using it and it has only one cache instance in it. So the owner of the cache is that cache instance.</p>
  
  <p>Why is it not able to close it and returns <code>false</code> in the end?</p>
  
  <p>Thanks</p>
  
  <p>Ali</p>