0

I noticed that while calling lock/unlock on a ReentrantReadWrite lock, I am prompt with two lock and unlock methods. locks

For example, in the WriteLock I have a Lock() with -75% and another Lock() with no %. Both of these have the same documentations. I tried to find a reason online, but could not find any explanation. Is it just a bug in eclipse?

Quantico
  • 2,398
  • 7
  • 35
  • 59
  • this is just eclipse's prediction I believe, it ranks methods by relevancy of use. – TTT Apr 14 '14 at 20:03
  • the odd thing is that the ReadLock is 25%, and the unlock are 50% both. So I am trying to understand if this is a prediction of write vs. read (which sounds odd, because you perform more reads), or is it something else – Quantico Apr 14 '14 at 20:06
  • this is just eclipse trying to predict what you're going to use for your convenience, much like microsoft's intellisense. – TTT Apr 14 '14 at 20:07

1 Answers1

2

You might want to double-check those method names.

ReentrantReadWriteLock doesn't have a Lock method. It has public ReentrantReadWriteLock.ReadLock readLock() and public ReentrantReadWriteLock.WriteLock writeLock(). Those both implement the Lock interface and have lock(), lockInterruptibly(), unlock(), and trylock() methods.

The WriteLock has a few extra methods since write locks are generally exclusive.

Powerlord
  • 87,612
  • 17
  • 125
  • 175
  • Powelord, you are right I should have included this in my question, but even for WriteLock the two writelocks calls differ by this %. I guess as rpg711 said it is a prediction. – Quantico Apr 15 '14 at 21:49