Remove usage of some deprecated functions.
Updating ThreadWorker.