Now... By timeout I am assuming that you mean some sort of results return when the task is not completed within a certain amount of time. Unfortunately, you will have to implement this yourself.
Have your long running task periodically check a certain flag, say some sort of abort flag. If the abort flag is set, then it will have to exit cleanly. You will then need another timer task which will set this abort flag, and report that the timeout occurred.