If we use a `deferToThread` we will also need mutex for the variables, so I would advice against that approach.