{"action":"created","comment":{"url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/comments/57468016","id":57468016,"diff_hunk":"@@ -191,15 +169,10 @@ static int qemu_tcg_init_vcpu(CPUState *cpu)\n         uc->tcg_halt_cond = cpu->halt_cond;\n         snprintf(thread_name, VCPU_THREAD_NAME_SIZE, \"CPU %d/TCG\",\n                 cpu->cpu_index);\n-        if (qemu_thread_create(uc, cpu->thread, thread_name, qemu_tcg_cpu_thread_fn,\n-                cpu, QEMU_THREAD_JOINABLE))\n-            return -1;\n+        qemu_thread_get_self(uc, cpu->thread);","path":"qemu/cpus.c","position":82,"original_position":82,"commit_id":"f0af8f828226285ce095bc9a736fffba50e54cb5","original_commit_id":"f0af8f828226285ce095bc9a736fffba50e54cb5","user":{"login":"lunixbochs","id":117642,"avatar_url":"https://avatars.githubusercontent.com/u/117642?v=3","gravatar_id":"","url":"https://api.github.com/users/lunixbochs","html_url":"https://github.com/lunixbochs","followers_url":"https://api.github.com/users/lunixbochs/followers","following_url":"https://api.github.com/users/lunixbochs/following{/other_user}","gists_url":"https://api.github.com/users/lunixbochs/gists{/gist_id}","starred_url":"https://api.github.com/users/lunixbochs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunixbochs/subscriptions","organizations_url":"https://api.github.com/users/lunixbochs/orgs","repos_url":"https://api.github.com/users/lunixbochs/repos","events_url":"https://api.github.com/users/lunixbochs/events{/privacy}","received_events_url":"https://api.github.com/users/lunixbochs/received_events","type":"User","site_admin":false},"body":"I want to be able to emulate multi-threaded code, but right now my best plan is to thread my host program and schedule `uc_emu_start()` threads manually.\r\n\r\nI think Unicorn would do a much better job than me with cache coherency, as I have no idea what a memory fence/barrier/etc would do across two Unicorn instances with `mem_map_ptr`-shared memory.","created_at":"2016-03-25T17:36:44Z","updated_at":"2016-03-25T17:36:44Z","html_url":"https://github.com/unicorn-engine/unicorn/pull/481#discussion_r57468016","pull_request_url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481","_links":{"self":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/comments/57468016"},"html":{"href":"https://github.com/unicorn-engine/unicorn/pull/481#discussion_r57468016"},"pull_request":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481"}}},"pull_request":{"url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481","id":63992513,"html_url":"https://github.com/unicorn-engine/unicorn/pull/481","diff_url":"https://github.com/unicorn-engine/unicorn/pull/481.diff","patch_url":"https://github.com/unicorn-engine/unicorn/pull/481.patch","issue_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/481","number":481,"state":"open","locked":false,"title":"execute cpus in same thread as uc_emu_start()","user":{"login":"lunixbochs","id":117642,"avatar_url":"https://avatars.githubusercontent.com/u/117642?v=3","gravatar_id":"","url":"https://api.github.com/users/lunixbochs","html_url":"https://github.com/lunixbochs","followers_url":"https://api.github.com/users/lunixbochs/followers","following_url":"https://api.github.com/users/lunixbochs/following{/other_user}","gists_url":"https://api.github.com/users/lunixbochs/gists{/gist_id}","starred_url":"https://api.github.com/users/lunixbochs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunixbochs/subscriptions","organizations_url":"https://api.github.com/users/lunixbochs/orgs","repos_url":"https://api.github.com/users/lunixbochs/repos","events_url":"https://api.github.com/users/lunixbochs/events{/privacy}","received_events_url":"https://api.github.com/users/lunixbochs/received_events","type":"User","site_admin":false},"body":"There's no change to samples_all.sh output, and all regression tests looked to pass the same.\r\n\r\nnote: I'm pretty sure this makes some dead code, but I wanted the least intrusive patch possible","created_at":"2016-03-24T05:44:32Z","updated_at":"2016-03-25T17:36:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b41d6d95774c738f0bcda4e0d73bb5dc6b48dc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481/commits","review_comments_url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481/comments","review_comment_url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/481/comments","statuses_url":"https://api.github.com/repos/unicorn-engine/unicorn/statuses/f0af8f828226285ce095bc9a736fffba50e54cb5","head":{"label":"lunixbochs:master","ref":"master","sha":"f0af8f828226285ce095bc9a736fffba50e54cb5","user":{"login":"lunixbochs","id":117642,"avatar_url":"https://avatars.githubusercontent.com/u/117642?v=3","gravatar_id":"","url":"https://api.github.com/users/lunixbochs","html_url":"https://github.com/lunixbochs","followers_url":"https://api.github.com/users/lunixbochs/followers","following_url":"https://api.github.com/users/lunixbochs/following{/other_user}","gists_url":"https://api.github.com/users/lunixbochs/gists{/gist_id}","starred_url":"https://api.github.com/users/lunixbochs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunixbochs/subscriptions","organizations_url":"https://api.github.com/users/lunixbochs/orgs","repos_url":"https://api.github.com/users/lunixbochs/repos","events_url":"https://api.github.com/users/lunixbochs/events{/privacy}","received_events_url":"https://api.github.com/users/lunixbochs/received_events","type":"User","site_admin":false},"repo":{"id":44385442,"name":"unicorn","full_name":"lunixbochs/unicorn","owner":{"login":"lunixbochs","id":117642,"avatar_url":"https://avatars.githubusercontent.com/u/117642?v=3","gravatar_id":"","url":"https://api.github.com/users/lunixbochs","html_url":"https://github.com/lunixbochs","followers_url":"https://api.github.com/users/lunixbochs/followers","following_url":"https://api.github.com/users/lunixbochs/following{/other_user}","gists_url":"https://api.github.com/users/lunixbochs/gists{/gist_id}","starred_url":"https://api.github.com/users/lunixbochs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunixbochs/subscriptions","organizations_url":"https://api.github.com/users/lunixbochs/orgs","repos_url":"https://api.github.com/users/lunixbochs/repos","events_url":"https://api.github.com/users/lunixbochs/events{/privacy}","received_events_url":"https://api.github.com/users/lunixbochs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lunixbochs/unicorn","description":"Unicorn CPU emulator engine","fork":true,"url":"https://api.github.com/repos/lunixbochs/unicorn","forks_url":"https://api.github.com/repos/lunixbochs/unicorn/forks","keys_url":"https://api.github.com/repos/lunixbochs/unicorn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lunixbochs/unicorn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lunixbochs/unicorn/teams","hooks_url":"https://api.github.com/repos/lunixbochs/unicorn/hooks","issue_events_url":"https://api.github.com/repos/lunixbochs/unicorn/issues/events{/number}","events_url":"https://api.github.com/repos/lunixbochs/unicorn/events","assignees_url":"https://api.github.com/repos/lunixbochs/unicorn/assignees{/user}","branches_url":"https://api.github.com/repos/lunixbochs/unicorn/branches{/branch}","tags_url":"https://api.github.com/repos/lunixbochs/unicorn/tags","blobs_url":"https://api.github.com/repos/lunixbochs/unicorn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lunixbochs/unicorn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lunixbochs/unicorn/git/refs{/sha}","trees_url":"https://api.github.com/repos/lunixbochs/unicorn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lunixbochs/unicorn/statuses/{sha}","languages_url":"https://api.github.com/repos/lunixbochs/unicorn/languages","stargazers_url":"https://api.github.com/repos/lunixbochs/unicorn/stargazers","contributors_url":"https://api.github.com/repos/lunixbochs/unicorn/contributors","subscribers_url":"https://api.github.com/repos/lunixbochs/unicorn/subscribers","subscription_url":"https://api.github.com/repos/lunixbochs/unicorn/subscription","commits_url":"https://api.github.com/repos/lunixbochs/unicorn/commits{/sha}","git_commits_url":"https://api.github.com/repos/lunixbochs/unicorn/git/commits{/sha}","comments_url":"https://api.github.com/repos/lunixbochs/unicorn/comments{/number}","issue_comment_url":"https://api.github.com/repos/lunixbochs/unicorn/issues/comments{/number}","contents_url":"https://api.github.com/repos/lunixbochs/unicorn/contents/{+path}","compare_url":"https://api.github.com/repos/lunixbochs/unicorn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lunixbochs/unicorn/merges","archive_url":"https://api.github.com/repos/lunixbochs/unicorn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lunixbochs/unicorn/downloads","issues_url":"https://api.github.com/repos/lunixbochs/unicorn/issues{/number}","pulls_url":"https://api.github.com/repos/lunixbochs/unicorn/pulls{/number}","milestones_url":"https://api.github.com/repos/lunixbochs/unicorn/milestones{/number}","notifications_url":"https://api.github.com/repos/lunixbochs/unicorn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lunixbochs/unicorn/labels{/name}","releases_url":"https://api.github.com/repos/lunixbochs/unicorn/releases{/id}","deployments_url":"https://api.github.com/repos/lunixbochs/unicorn/deployments","created_at":"2015-10-16T13:00:52Z","updated_at":"2016-01-11T07:50:04Z","pushed_at":"2016-03-24T15:57:37Z","git_url":"git://github.com/lunixbochs/unicorn.git","ssh_url":"git@github.com:lunixbochs/unicorn.git","clone_url":"https://github.com/lunixbochs/unicorn.git","svn_url":"https://github.com/lunixbochs/unicorn","homepage":"http://www.unicorn-engine.org","size":5296,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"unicorn-engine:master","ref":"master","sha":"86823f53da4cb97d61f969b98391b9ea2cb94d55","user":{"login":"unicorn-engine","id":13391512,"avatar_url":"https://avatars.githubusercontent.com/u/13391512?v=3","gravatar_id":"","url":"https://api.github.com/users/unicorn-engine","html_url":"https://github.com/unicorn-engine","followers_url":"https://api.github.com/users/unicorn-engine/followers","following_url":"https://api.github.com/users/unicorn-engine/following{/other_user}","gists_url":"https://api.github.com/users/unicorn-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/unicorn-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicorn-engine/subscriptions","organizations_url":"https://api.github.com/users/unicorn-engine/orgs","repos_url":"https://api.github.com/users/unicorn-engine/repos","events_url":"https://api.github.com/users/unicorn-engine/events{/privacy}","received_events_url":"https://api.github.com/users/unicorn-engine/received_events","type":"Organization","site_admin":false},"repo":{"id":41107037,"name":"unicorn","full_name":"unicorn-engine/unicorn","owner":{"login":"unicorn-engine","id":13391512,"avatar_url":"https://avatars.githubusercontent.com/u/13391512?v=3","gravatar_id":"","url":"https://api.github.com/users/unicorn-engine","html_url":"https://github.com/unicorn-engine","followers_url":"https://api.github.com/users/unicorn-engine/followers","following_url":"https://api.github.com/users/unicorn-engine/following{/other_user}","gists_url":"https://api.github.com/users/unicorn-engine/gists{/gist_id}","starred_url":"https://api.github.com/users/unicorn-engine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicorn-engine/subscriptions","organizations_url":"https://api.github.com/users/unicorn-engine/orgs","repos_url":"https://api.github.com/users/unicorn-engine/repos","events_url":"https://api.github.com/users/unicorn-engine/events{/privacy}","received_events_url":"https://api.github.com/users/unicorn-engine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unicorn-engine/unicorn","description":"Unicorn CPU emulator engine","fork":false,"url":"https://api.github.com/repos/unicorn-engine/unicorn","forks_url":"https://api.github.com/repos/unicorn-engine/unicorn/forks","keys_url":"https://api.github.com/repos/unicorn-engine/unicorn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unicorn-engine/unicorn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unicorn-engine/unicorn/teams","hooks_url":"https://api.github.com/repos/unicorn-engine/unicorn/hooks","issue_events_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/events{/number}","events_url":"https://api.github.com/repos/unicorn-engine/unicorn/events","assignees_url":"https://api.github.com/repos/unicorn-engine/unicorn/assignees{/user}","branches_url":"https://api.github.com/repos/unicorn-engine/unicorn/branches{/branch}","tags_url":"https://api.github.com/repos/unicorn-engine/unicorn/tags","blobs_url":"https://api.github.com/repos/unicorn-engine/unicorn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unicorn-engine/unicorn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unicorn-engine/unicorn/git/refs{/sha}","trees_url":"https://api.github.com/repos/unicorn-engine/unicorn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unicorn-engine/unicorn/statuses/{sha}","languages_url":"https://api.github.com/repos/unicorn-engine/unicorn/languages","stargazers_url":"https://api.github.com/repos/unicorn-engine/unicorn/stargazers","contributors_url":"https://api.github.com/repos/unicorn-engine/unicorn/contributors","subscribers_url":"https://api.github.com/repos/unicorn-engine/unicorn/subscribers","subscription_url":"https://api.github.com/repos/unicorn-engine/unicorn/subscription","commits_url":"https://api.github.com/repos/unicorn-engine/unicorn/commits{/sha}","git_commits_url":"https://api.github.com/repos/unicorn-engine/unicorn/git/commits{/sha}","comments_url":"https://api.github.com/repos/unicorn-engine/unicorn/comments{/number}","issue_comment_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/comments{/number}","contents_url":"https://api.github.com/repos/unicorn-engine/unicorn/contents/{+path}","compare_url":"https://api.github.com/repos/unicorn-engine/unicorn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unicorn-engine/unicorn/merges","archive_url":"https://api.github.com/repos/unicorn-engine/unicorn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unicorn-engine/unicorn/downloads","issues_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues{/number}","pulls_url":"https://api.github.com/repos/unicorn-engine/unicorn/pulls{/number}","milestones_url":"https://api.github.com/repos/unicorn-engine/unicorn/milestones{/number}","notifications_url":"https://api.github.com/repos/unicorn-engine/unicorn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unicorn-engine/unicorn/labels{/name}","releases_url":"https://api.github.com/repos/unicorn-engine/unicorn/releases{/id}","deployments_url":"https://api.github.com/repos/unicorn-engine/unicorn/deployments","created_at":"2015-08-20T16:35:45Z","updated_at":"2016-03-25T14:22:11Z","pushed_at":"2016-03-25T16:33:34Z","git_url":"git://github.com/unicorn-engine/unicorn.git","ssh_url":"git@github.com:unicorn-engine/unicorn.git","clone_url":"https://github.com/unicorn-engine/unicorn.git","svn_url":"https://github.com/unicorn-engine/unicorn","homepage":"http://www.unicorn-engine.org","size":5753,"stargazers_count":545,"watchers_count":545,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"open_issues_count":106,"forks":103,"open_issues":106,"watchers":545,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481"},"html":{"href":"https://github.com/unicorn-engine/unicorn/pull/481"},"issue":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/issues/481"},"comments":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/issues/481/comments"},"review_comments":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481/comments"},"review_comment":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/pulls/481/commits"},"statuses":{"href":"https://api.github.com/repos/unicorn-engine/unicorn/statuses/f0af8f828226285ce095bc9a736fffba50e54cb5"}}}}