{"action":"created","comment":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/51560840","id":51560840,"diff_hunk":"@@ -0,0 +1,81 @@\n+/* This file is part of magic-sdk, an sdk for the open source programming language magic.\n+ *\n+ * Copyright (C) 2016 magic-lang\n+ *\n+ * This software may be modified and distributed under the terms\n+ * of the MIT license.  See the LICENSE file for details.\n+ */\n+\n+use base\n+use concurrent\n+import threading/Thread\n+import threading/Mutex\n+import structs/HashMap\n+\n+SynchronizedResource: abstract class {\n+\t_threadAffinity := 0L\n+\t_recycle := true\n+\tinit: func { this _threadAffinity = Thread currentThreadId() }\n+\tcheckThreadAffinity: func -> Bool {\n+\t\tThread equals(this _threadAffinity, Thread currentThreadId())\n+\t}\n+}\n+\n+SynchronizedResourceRecycler: class {\n+\t_mutex := Mutex new()\n+\t_resources := HashMap<Long, VectorList<SynchronizedResource>> new()","path":"source/concurrent/SynchronizedResource.ooc","position":26,"original_position":26,"commit_id":"07254a3acf8847922374f004979c2bea11c7f8ab","original_commit_id":"07254a3acf8847922374f004979c2bea11c7f8ab","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"body":"Yeah I don't think it really matters compared to, for example, the GPU upload overhead etc.","created_at":"2016-02-02T12:20:54Z","updated_at":"2016-02-02T12:20:54Z","html_url":"https://github.com/magic-lang/ooc-kean/pull/1266#discussion_r51560840","pull_request_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266","_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/51560840"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1266#discussion_r51560840"},"pull_request":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266"}}},"pull_request":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266","id":57349531,"html_url":"https://github.com/magic-lang/ooc-kean/pull/1266","diff_url":"https://github.com/magic-lang/ooc-kean/pull/1266.diff","patch_url":"https://github.com/magic-lang/ooc-kean/pull/1266.patch","issue_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1266","number":1266,"state":"open","locked":false,"title":"base class for synchronized resource","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"body":"prototype for https://github.com/magic-lang/ooc-kean/issues/1256\r\nnot for review yet","created_at":"2016-01-27T11:54:07Z","updated_at":"2016-02-02T12:20:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32e065ad02282892400bc4da577417693b59c474","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266/commits","review_comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266/comments","review_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1266/comments","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/07254a3acf8847922374f004979c2bea11c7f8ab","head":{"label":"sebastianbaginski:threadedresources","ref":"threadedresources","sha":"07254a3acf8847922374f004979c2bea11c7f8ab","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"repo":{"id":39762712,"name":"ooc-kean","full_name":"sebastianbaginski/ooc-kean","owner":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebastianbaginski/ooc-kean","description":"ooc port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/sebastianbaginski/ooc-kean","forks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/forks","keys_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/teams","hooks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/events","assignees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/tags","blobs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscription","commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/merges","archive_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/downloads","issues_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/deployments","created_at":"2015-07-27T08:08:08Z","updated_at":"2016-01-11T17:58:42Z","pushed_at":"2016-02-02T11:38:40Z","git_url":"git://github.com/sebastianbaginski/ooc-kean.git","ssh_url":"git@github.com:sebastianbaginski/ooc-kean.git","clone_url":"https://github.com/sebastianbaginski/ooc-kean.git","svn_url":"https://github.com/sebastianbaginski/ooc-kean","homepage":"","size":31047,"stargazers_count":0,"watchers_count":0,"language":"ooc","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":"magic-lang:master","ref":"master","sha":"f04e59d4195b6f9ed412bdf72c622f88ea619bb7","user":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"magic-lang/ooc-kean","owner":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magic-lang/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/magic-lang/ooc-kean","forks_url":"https://api.github.com/repos/magic-lang/ooc-kean/forks","keys_url":"https://api.github.com/repos/magic-lang/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magic-lang/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magic-lang/ooc-kean/teams","hooks_url":"https://api.github.com/repos/magic-lang/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/magic-lang/ooc-kean/events","assignees_url":"https://api.github.com/repos/magic-lang/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/magic-lang/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/tags","blobs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/magic-lang/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/magic-lang/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/magic-lang/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscription","commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/magic-lang/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/magic-lang/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magic-lang/ooc-kean/merges","archive_url":"https://api.github.com/repos/magic-lang/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magic-lang/ooc-kean/downloads","issues_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/magic-lang/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/magic-lang/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magic-lang/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/magic-lang/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/magic-lang/ooc-kean/deployments","created_at":"2014-10-15T13:42:17Z","updated_at":"2016-01-21T11:50:29Z","pushed_at":"2016-02-02T12:07:56Z","git_url":"git://github.com/magic-lang/ooc-kean.git","ssh_url":"git@github.com:magic-lang/ooc-kean.git","clone_url":"https://github.com/magic-lang/ooc-kean.git","svn_url":"https://github.com/magic-lang/ooc-kean","homepage":"","size":30902,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":48,"forks":19,"open_issues":48,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1266"},"issue":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1266"},"comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1266/comments"},"review_comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266/comments"},"review_comment":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1266/commits"},"statuses":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/07254a3acf8847922374f004979c2bea11c7f8ab"}}}}