{"action":"created","issue":{"url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/4","repository_url":"https://api.github.com/repos/iTXTech/PocketMine-MP","labels_url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/4/comments","events_url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/4/events","html_url":"https://github.com/iTXTech/PocketMine-MP/pull/4","id":178457276,"number":4,"title":"Fix CommandReader hanging at shutdown on Windows","user":{"login":"dktapps","id":14214667,"avatar_url":"https://avatars.githubusercontent.com/u/14214667?v=3","gravatar_id":"","url":"https://api.github.com/users/dktapps","html_url":"https://github.com/dktapps","followers_url":"https://api.github.com/users/dktapps/followers","following_url":"https://api.github.com/users/dktapps/following{/other_user}","gists_url":"https://api.github.com/users/dktapps/gists{/gist_id}","starred_url":"https://api.github.com/users/dktapps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dktapps/subscriptions","organizations_url":"https://api.github.com/users/dktapps/orgs","repos_url":"https://api.github.com/users/dktapps/repos","events_url":"https://api.github.com/users/dktapps/events{/privacy}","received_events_url":"https://api.github.com/users/dktapps/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-21T20:43:04Z","updated_at":"2016-09-22T08:38:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iTXTech/PocketMine-MP/pulls/4","html_url":"https://github.com/iTXTech/PocketMine-MP/pull/4","diff_url":"https://github.com/iTXTech/PocketMine-MP/pull/4.diff","patch_url":"https://github.com/iTXTech/PocketMine-MP/pull/4.patch"},"body":"## Description\r\n\r\nWindows doesn't do non-blocking streams, which is somewhat irritating. For the most part this won't affect a thing, because it just means the CommandReader thread is blocked until a command is entered. However, on shutdown this causes issues, because the CR needs input to escape that blocking fgets() causing it to hang. Previously this was noticeable because the thread would continue to hang until pressing Enter. (More recently, this hasn't been noticeable due to a pthreads bug causing a shutdown crash.)\r\n\r\nThis PR fixes the issue by using stream_select to check for changes in stdin *before* making the blocking fgets() call. This brings the behaviour more in line with Linux. This is not so much a fix as it is a workaround for a very old issue.\r\n\r\n## Tests\r\nTested on Android and Windows, but not thoroughly. I noticed no issues under any circumstances.\r\nThis modification should not affect any platform except Windows."},"comment":{"url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/comments/248843513","html_url":"https://github.com/iTXTech/PocketMine-MP/pull/4#issuecomment-248843513","issue_url":"https://api.github.com/repos/iTXTech/PocketMine-MP/issues/4","id":248843513,"user":{"login":"ishitatsuyuki","id":12389383,"avatar_url":"https://avatars.githubusercontent.com/u/12389383?v=3","gravatar_id":"","url":"https://api.github.com/users/ishitatsuyuki","html_url":"https://github.com/ishitatsuyuki","followers_url":"https://api.github.com/users/ishitatsuyuki/followers","following_url":"https://api.github.com/users/ishitatsuyuki/following{/other_user}","gists_url":"https://api.github.com/users/ishitatsuyuki/gists{/gist_id}","starred_url":"https://api.github.com/users/ishitatsuyuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishitatsuyuki/subscriptions","organizations_url":"https://api.github.com/users/ishitatsuyuki/orgs","repos_url":"https://api.github.com/users/ishitatsuyuki/repos","events_url":"https://api.github.com/users/ishitatsuyuki/events{/privacy}","received_events_url":"https://api.github.com/users/ishitatsuyuki/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T08:38:09Z","updated_at":"2016-09-22T08:38:09Z","body":"Neither does PM. This is a little bit inefficient, laggy and bad."}}
{"actor":{"display_login":"ishitatsuyuki"}}