Replacing the deprecated example 18-7 with a simple asynchronous method call using the thread function.