Threaded task execution through inheritance and passing func ref.