{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/pxt/issues/2385","repository_url":"https://api.github.com/repos/Microsoft/pxt","labels_url":"https://api.github.com/repos/Microsoft/pxt/issues/2385/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/pxt/issues/2385/comments","events_url":"https://api.github.com/repos/Microsoft/pxt/issues/2385/events","html_url":"https://github.com/Microsoft/pxt/issues/2385","id":240036845,"number":2385,"title":"Pause in \"on start\" does not delay \"forever\" loops?","user":{"login":"microbit-carlos","id":29712657,"avatar_url":"https://avatars3.githubusercontent.com/u/29712657?v=3","gravatar_id":"","url":"https://api.github.com/users/microbit-carlos","html_url":"https://github.com/microbit-carlos","followers_url":"https://api.github.com/users/microbit-carlos/followers","following_url":"https://api.github.com/users/microbit-carlos/following{/other_user}","gists_url":"https://api.github.com/users/microbit-carlos/gists{/gist_id}","starred_url":"https://api.github.com/users/microbit-carlos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/microbit-carlos/subscriptions","organizations_url":"https://api.github.com/users/microbit-carlos/orgs","repos_url":"https://api.github.com/users/microbit-carlos/repos","events_url":"https://api.github.com/users/microbit-carlos/events{/privacy}","received_events_url":"https://api.github.com/users/microbit-carlos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-02T21:50:08Z","updated_at":"2017-07-03T20:39:06Z","closed_at":"2017-07-03T20:39:06Z","body":"microbit.org-ticket: 2187\r\n\r\nAren't the \"forever\" loops meant to start running after the \"on start\" blocks have finished?\r\n\r\nIf we need to initialise something before it can be used (like neopixels or game sprites), the \"on start\" is usually the preferred place to do that, but if the \"forever\" loops are declared before the \"on start\" code, and then the main fibre sleeps, you could have a race condition like in the following example:\r\n\r\n![microbit-screenshot](https://user-images.githubusercontent.com/29712657/27773713-e13ff006-5f77-11e7-8689-3b686d53e81d.png)\r\n\r\nThis program produces the following error and crashes the emulator:\r\n\r\n```\r\nProgram Error: r.isRef is not a function\r\n```\r\n\r\n\r\nHex file with this minimalist example: [issue.zip](https://github.com/Microsoft/pxt/files/1118125/issue.zip)\r\n"}}
{"actor":{"display_login":"abchatra"}}