I'm using Poco::ServerApplication
and Poco::TaskManager
at the same time and encountered a wired problem.
If start without --daemon
option, everything is ok. However when start with --daemon
, the task passed to the taskmanager is never started. I debugged it with gdb and found that when with --daemon
option, threads in the taskmanager's inner taskpool were started and soon stopped. So when calling TaskManager::start
, it just uses an already finished thread and thus the task is never started.
I wonder if this is because of any restriction to a linux daemon, or is there anything else will cause this problem?
Here is the sample code which can reproduce the problem on my box.
http://codepaste.net/jhoyt5
Sorry for my poor English :P. And I would appreciate any ideas?