Add support for multithreading (archipelago).