Modify Thread interrupt operation to make timeout work