{"action":"created","issue":{"url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/36","labels_url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/36/comments","events_url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/36/events","html_url":"https://github.com/JorenSix/TarsosDSP/issues/36","id":60745675,"number":36,"title":"AudioDispatcher thread hangs on close()","user":{"login":"kizinfo","id":5999119,"avatar_url":"https://avatars.githubusercontent.com/u/5999119?v=3","gravatar_id":"","url":"https://api.github.com/users/kizinfo","html_url":"https://github.com/kizinfo","followers_url":"https://api.github.com/users/kizinfo/followers","following_url":"https://api.github.com/users/kizinfo/following{/other_user}","gists_url":"https://api.github.com/users/kizinfo/gists{/gist_id}","starred_url":"https://api.github.com/users/kizinfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kizinfo/subscriptions","organizations_url":"https://api.github.com/users/kizinfo/orgs","repos_url":"https://api.github.com/users/kizinfo/repos","events_url":"https://api.github.com/users/kizinfo/events{/privacy}","received_events_url":"https://api.github.com/users/kizinfo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-11T23:12:15Z","updated_at":"2015-04-07T12:42:09Z","closed_at":"2015-04-07T12:42:09Z","body":"Calling AudioDispatcher.stop() from another thread causes the dispatch audioLoop to hang instead of exit. There is some concurrency issue in there. waiting for the audioLoop to finish before calling AudioDispatcher.stop() seems to be a hack that works but you may need to solve the root cause. (also variables such as 'stopped' that are used as access control between threads should be declared volatile).\r\n\r\nAlso, just doing a local 'break' instead of 'break audioLoop' in the AudioDispatcher allows you prevent the processor chain from continuing to run without actually stopping the whole process - which you should use stop() for. I found this useful for creating control gates (which return false) that prevent further processing until some threshold etc. has been achieved."},"comment":{"url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/comments/90535304","html_url":"https://github.com/JorenSix/TarsosDSP/issues/36#issuecomment-90535304","issue_url":"https://api.github.com/repos/JorenSix/TarsosDSP/issues/36","id":90535304,"user":{"login":"JorenSix","id":60453,"avatar_url":"https://avatars.githubusercontent.com/u/60453?v=3","gravatar_id":"","url":"https://api.github.com/users/JorenSix","html_url":"https://github.com/JorenSix","followers_url":"https://api.github.com/users/JorenSix/followers","following_url":"https://api.github.com/users/JorenSix/following{/other_user}","gists_url":"https://api.github.com/users/JorenSix/gists{/gist_id}","starred_url":"https://api.github.com/users/JorenSix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JorenSix/subscriptions","organizations_url":"https://api.github.com/users/JorenSix/orgs","repos_url":"https://api.github.com/users/JorenSix/repos","events_url":"https://api.github.com/users/JorenSix/events{/privacy}","received_events_url":"https://api.github.com/users/JorenSix/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T12:42:09Z","updated_at":"2015-04-07T12:42:09Z","body":"Hi, with the latest version things got cleaned up quite a lot. There are also some unit tests that check for some marginal conditions. Check it out!"}}