Seems to fix hanging. Unfortunately, can't be sure if it avoids all hangs. More testing...
Merge branch 'master' of github.com:molohov/gpu2
Merge branch 'master' of github.com:molohov/gpu2