convert sleep(const) to nmsleep()
hotplug use get_thread() where appropriate