{"action":"closed","issue":{"url":"https://api.github.com/repos/MoarVM/MoarVM/issues/166","labels_url":"https://api.github.com/repos/MoarVM/MoarVM/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/MoarVM/MoarVM/issues/166/comments","events_url":"https://api.github.com/repos/MoarVM/MoarVM/issues/166/events","html_url":"https://github.com/MoarVM/MoarVM/issues/166","id":53989739,"number":166,"title":"Various threading exceptions","user":{"login":"tgt","id":472609,"avatar_url":"https://avatars.githubusercontent.com/u/472609?v=3","gravatar_id":"","url":"https://api.github.com/users/tgt","html_url":"https://github.com/tgt","followers_url":"https://api.github.com/users/tgt/followers","following_url":"https://api.github.com/users/tgt/following{/other_user}","gists_url":"https://api.github.com/users/tgt/gists{/gist_id}","starred_url":"https://api.github.com/users/tgt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgt/subscriptions","organizations_url":"https://api.github.com/users/tgt/orgs","repos_url":"https://api.github.com/users/tgt/repos","events_url":"https://api.github.com/users/tgt/events{/privacy}","received_events_url":"https://api.github.com/users/tgt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-11T11:57:50Z","updated_at":"2015-11-09T13:43:17Z","closed_at":"2015-11-09T13:43:17Z","body":"```\r\nmy $n = 5;\r\n\r\nmy @locks = Lock.new xx $n;\r\n                     \r\nawait do for ^$n -> $i {\r\n    start {\r\n        @locks[$i].lock;\r\n        my $j = @locks[($i + 1) % $n];\r\n    }\r\n}\r\n```\r\n\r\nThe above code causes a variety of exceptions to be thrown:\r\n\r\n    Unhandled exception: No such method 'lock' for invocant of type 'Any'\r\n    Unhandled exception: MVMArray: Can't shift from an empty array\r\n    Unhandled exception in code scheduled on thread 4474798080\r\n\r\nI've also seen it segfault, although this is much rarer than he above exceptions. Sometimes it runs to completion.\r\n\r\nI'm running on OS X 10.10.1 and \"This is perl6 version 2014.12-142-g8f447f8 built on MoarVM version 2014.12-4-g7e95c05\""}}