{"action":"closed","issue":{"url":"https://api.github.com/repos/google/guava/issues/2653","repository_url":"https://api.github.com/repos/google/guava","labels_url":"https://api.github.com/repos/google/guava/issues/2653/labels{/name}","comments_url":"https://api.github.com/repos/google/guava/issues/2653/comments","events_url":"https://api.github.com/repos/google/guava/issues/2653/events","html_url":"https://github.com/google/guava/issues/2653","id":190481750,"number":2653,"title":"Striped<Lock> deadlock when use different key in concurrent thread","user":{"login":"flym","id":2046979,"avatar_url":"https://avatars.githubusercontent.com/u/2046979?v=3","gravatar_id":"","url":"https://api.github.com/users/flym","html_url":"https://github.com/flym","followers_url":"https://api.github.com/users/flym/followers","following_url":"https://api.github.com/users/flym/following{/other_user}","gists_url":"https://api.github.com/users/flym/gists{/gist_id}","starred_url":"https://api.github.com/users/flym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flym/subscriptions","organizations_url":"https://api.github.com/users/flym/orgs","repos_url":"https://api.github.com/users/flym/repos","events_url":"https://api.github.com/users/flym/events{/privacy}","received_events_url":"https://api.github.com/users/flym/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-19T07:12:55Z","updated_at":"2016-11-30T13:27:04Z","closed_at":"2016-11-30T13:27:04Z","body":"we use striped<Lock> generate lock to gurantee sync operation.but we detect thread dead lock when multi thread run.\r\n\r\nexample:\r\n\r\n```\r\nthread1->getLock(A1)->getLock(B1)\r\n\r\nthread2->getLock(A2)->getLock(B2)\r\n```\r\n\r\nall use striped.get(key) and lock.lock then run...\r\n\r\ni read the code,found that guava **only** use key hashcode and size to identity bucket,when identify same bucket,it may return the wrong lock.\r\nas before,when getLock(A2),it may return B1 lock. just then same bucket.'\r\n\r\ni think it must use the **strict** equals to get the right lock,just as the concurrentHashMap do it."}}
{"actor":{"display_login":"flym"}}