Use throwIO instead of throw in runInBoundThread and runInUnboundThread