Threading part 2c

Squashed commit for neobrain.See https://github.com/citra-emu/citra/pull/11 and https://github.com/citra-emu/citra/pull/17.