{"action":"created","issue":{"url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/3","labels_url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/3/comments","events_url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/3/events","html_url":"https://github.com/TehShrike/read-write-lock/issues/3","id":75439289,"number":3,"title":"zalgo","user":{"login":"ArtskydJ","id":1833684,"avatar_url":"https://avatars.githubusercontent.com/u/1833684?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtskydJ","html_url":"https://github.com/ArtskydJ","followers_url":"https://api.github.com/users/ArtskydJ/followers","following_url":"https://api.github.com/users/ArtskydJ/following{/other_user}","gists_url":"https://api.github.com/users/ArtskydJ/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtskydJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtskydJ/subscriptions","organizations_url":"https://api.github.com/users/ArtskydJ/orgs","repos_url":"https://api.github.com/users/ArtskydJ/repos","events_url":"https://api.github.com/users/ArtskydJ/events{/privacy}","received_events_url":"https://api.github.com/users/ArtskydJ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T03:05:24Z","updated_at":"2015-05-12T03:12:10Z","closed_at":null,"body":"In a real-world situation, it's hard to know if a callback will be called synchronously or asynchronously.\r\n\r\n```js\r\nvar createMutex = require('./')\r\nvar mutex = createMutex()\r\n\r\nemitter.on('event', function () {\r\n  console.log('before')\r\n  mutex.writeLock(function (release) {\r\n    console.log('    inside')\r\n    setTimeout(release, 100)\r\n  })\r\n  console.log('after')\r\n})\r\n```\r\nMaybe this:\r\n```\r\nbefore\r\n    inside\r\nafter\r\n```\r\nor maybe this:\r\n```\r\nbefore\r\nafter\r\n    inside\r\n```"},"comment":{"url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/comments/101112979","html_url":"https://github.com/TehShrike/read-write-lock/issues/3#issuecomment-101112979","issue_url":"https://api.github.com/repos/TehShrike/read-write-lock/issues/3","id":101112979,"user":{"login":"TehShrike","id":1141869,"avatar_url":"https://avatars.githubusercontent.com/u/1141869?v=3","gravatar_id":"","url":"https://api.github.com/users/TehShrike","html_url":"https://github.com/TehShrike","followers_url":"https://api.github.com/users/TehShrike/followers","following_url":"https://api.github.com/users/TehShrike/following{/other_user}","gists_url":"https://api.github.com/users/TehShrike/gists{/gist_id}","starred_url":"https://api.github.com/users/TehShrike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehShrike/subscriptions","organizations_url":"https://api.github.com/users/TehShrike/orgs","repos_url":"https://api.github.com/users/TehShrike/repos","events_url":"https://api.github.com/users/TehShrike/events{/privacy}","received_events_url":"https://api.github.com/users/TehShrike/received_events","type":"User","site_admin":false},"created_at":"2015-05-12T03:12:10Z","updated_at":"2015-05-12T03:12:10Z","body":"You're right, I broke that just tonight when I switched to using async-each in https://github.com/TehShrike/read-write-lock/commit/c524c950355c344ce3d9946367a207e9cad00082\r\n\r\nThis line should be run in `process.nextTick`: https://github.com/TehShrike/read-write-lock/blob/master/index.js#L12\r\n\r\nI'll change that quick for the next release."}}