{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16326","repository_url":"https://api.github.com/repos/cocos2d/cocos2d-x","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16326/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16326/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16326/events","html_url":"https://github.com/cocos2d/cocos2d-x/pull/16326","id":169581685,"number":16326,"title":"*Fix: GLThread and other threads access sDownloaderMap in a thread-un…","user":{"login":"pwang08","id":5799825,"avatar_url":"https://avatars.githubusercontent.com/u/5799825?v=3","gravatar_id":"","url":"https://api.github.com/users/pwang08","html_url":"https://github.com/pwang08","followers_url":"https://api.github.com/users/pwang08/followers","following_url":"https://api.github.com/users/pwang08/following{/other_user}","gists_url":"https://api.github.com/users/pwang08/gists{/gist_id}","starred_url":"https://api.github.com/users/pwang08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwang08/subscriptions","organizations_url":"https://api.github.com/users/pwang08/orgs","repos_url":"https://api.github.com/users/pwang08/repos","events_url":"https://api.github.com/users/pwang08/events{/privacy}","received_events_url":"https://api.github.com/users/pwang08/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-05T10:50:21Z","updated_at":"2016-08-12T01:51:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/pulls/16326","html_url":"https://github.com/cocos2d/cocos2d-x/pull/16326","diff_url":"https://github.com/cocos2d/cocos2d-x/pull/16326.diff","patch_url":"https://github.com/cocos2d/cocos2d-x/pull/16326.patch"},"body":"GLThread and other threads(`js_load_remote_image` creates CCDownloader in another thread) access `sDownloaderMap` in a thread-unsafe way, which will result in crash in some occasion on Android."},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/239342988","html_url":"https://github.com/cocos2d/cocos2d-x/pull/16326#issuecomment-239342988","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16326","id":239342988,"user":{"login":"dumganhar","id":493372,"avatar_url":"https://avatars.githubusercontent.com/u/493372?v=3","gravatar_id":"","url":"https://api.github.com/users/dumganhar","html_url":"https://github.com/dumganhar","followers_url":"https://api.github.com/users/dumganhar/followers","following_url":"https://api.github.com/users/dumganhar/following{/other_user}","gists_url":"https://api.github.com/users/dumganhar/gists{/gist_id}","starred_url":"https://api.github.com/users/dumganhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dumganhar/subscriptions","organizations_url":"https://api.github.com/users/dumganhar/orgs","repos_url":"https://api.github.com/users/dumganhar/repos","events_url":"https://api.github.com/users/dumganhar/events{/privacy}","received_events_url":"https://api.github.com/users/dumganhar/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T01:51:15Z","updated_at":"2016-08-12T01:51:15Z","body":"Hi, pwang08,\r\nI notice that `Downloader` instance is usually constructed in GL thread.\r\nAnd the callback functions are also invoked from GL thread. Could this cause thread problems?\r\n```c++\r\nCocos2dxHelper.runOnGLThread(new Runnable() {\r\n            @Override\r\n            public void run() {\r\n                nativeOnProgress(_id, id, downloadBytes, downloadNow, downloadTotal);\r\n            }\r\n        });\r\n```"}}
{"actor":{"display_login":"dumganhar"}}