{"action":"created","issue":{"url":"https://api.github.com/repos/proj4-bot/proj.4/issues/70","labels_url":"https://api.github.com/repos/proj4-bot/proj.4/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/proj4-bot/proj.4/issues/70/comments","events_url":"https://api.github.com/repos/proj4-bot/proj.4/issues/70/events","html_url":"https://github.com/proj4-bot/proj.4/issues/70","id":79329118,"number":70,"title":"Incorrect mutex handling causes a deadlock with multiple threads in pj_acquire_lock","user":{"login":"proj4-bot","id":12542084,"avatar_url":"https://avatars.githubusercontent.com/u/12542084?v=3","gravatar_id":"","url":"https://api.github.com/users/proj4-bot","html_url":"https://github.com/proj4-bot","followers_url":"https://api.github.com/users/proj4-bot/followers","following_url":"https://api.github.com/users/proj4-bot/following{/other_user}","gists_url":"https://api.github.com/users/proj4-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/proj4-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proj4-bot/subscriptions","organizations_url":"https://api.github.com/users/proj4-bot/orgs","repos_url":"https://api.github.com/users/proj4-bot/repos","events_url":"https://api.github.com/users/proj4-bot/events{/privacy}","received_events_url":"https://api.github.com/users/proj4-bot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/proj4-bot/proj.4/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/proj4-bot/proj.4/labels/C:%20Core","name":"C: Core","color":"0000aa"},{"url":"https://api.github.com/repos/proj4-bot/proj.4/labels/P:%20critical","name":"P: critical","color":"ffffb8"},{"url":"https://api.github.com/repos/proj4-bot/proj.4/labels/R:%20duplicate","name":"R: duplicate","color":"55ff55"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-22T07:20:01Z","updated_at":"2015-05-22T07:20:08Z","closed_at":"2015-05-22T07:20:04Z","body":"**Reported by tamas on 21 Mar 2010 21:28 UTC**\nSince a lock have been added in pj_gridlist_from_nadgrids(), proj.4 causes a deadlock when gridshift is used in a multithreaded environment on Windows.\r\n\r\nThe reason of this problem is that pj_init_lock creates the mutex with initial ownership = TRUE and pj_acquire_lock increases the lock count immediately by calling WaitForSingleObject. In this case ReleaseMutex should be called twice in order to set the mutex to signaled state. WIth the current approach a second thread calling pj_acquire_lock will be locked for infinite time.\r\n\r\nFor more information about this behaviour see the description of CreateMutex in the MSDN reference: http://msdn.microsoft.com/en-us/library/aa914601.aspx\r\n\r\nAttached the patch to fix this issue.  \n\nMigrated-From: https://trac.osgeo.org/proj/ticket/70"},"comment":{"url":"https://api.github.com/repos/proj4-bot/proj.4/issues/comments/104545183","html_url":"https://github.com/proj4-bot/proj.4/issues/70#issuecomment-104545183","issue_url":"https://api.github.com/repos/proj4-bot/proj.4/issues/70","id":104545183,"user":{"login":"proj4-bot","id":12542084,"avatar_url":"https://avatars.githubusercontent.com/u/12542084?v=3","gravatar_id":"","url":"https://api.github.com/users/proj4-bot","html_url":"https://github.com/proj4-bot","followers_url":"https://api.github.com/users/proj4-bot/followers","following_url":"https://api.github.com/users/proj4-bot/following{/other_user}","gists_url":"https://api.github.com/users/proj4-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/proj4-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proj4-bot/subscriptions","organizations_url":"https://api.github.com/users/proj4-bot/orgs","repos_url":"https://api.github.com/users/proj4-bot/repos","events_url":"https://api.github.com/users/proj4-bot/events{/privacy}","received_events_url":"https://api.github.com/users/proj4-bot/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T07:20:08Z","updated_at":"2015-05-22T07:20:08Z","body":"**Comment by tamas on 27 Mar 2010 09:41 UTC**\nFixed, but not in the stable branch. Since this is a breaking issue, it should be back ported. I never use the development version of proj.4 in my practice."}}