Yes, that should work so long as you know what you're doing in those doWork
and doSomething
methods.
Is it accessing data that other threads also can access? If so then you should think about protecting that using synchronized
or some other thread-safe method like message passing between threads using a thread-safe message queue. You'll have to think about what is best to solve your problem.
It would be interesting to know a little bit more about what it's doing because when you wrap it up in a thread you need to think about how to get data to and from that thread in a thread-safe manner. There is probably a simple and safe way to get the job done but it depends on the situation.