oleiade/lane — pull request #6 by deckarep (2014-04-10 18:27:02+00:00)
Title: Setting up PQueue to do proper locking by some minor refactoring

Please review this patch. Since Go locks are not re-entrant, I most likely ran into the same problem you did with having Size() have a read lock. The solution is to have an internal size() method that doesn't lock and provide a public Size() method with the RLock on it. This way, all the other methods can check the internal size() method and we don't have to worry about re-entrancy issues. Please review this, but I think it looks good.