Bug#445814: libcommoncpp2-1.5-0: onTimer() not called upon timer expiration in PosixThread
Michael Rumpler
mike at linux-solutions.at
Mon Oct 8 14:18:48 UTC 2007
On Mon, Oct 08, 2007 at 04:03:09PM +0200, Mikael Magnusson wrote:
> My observations follows:
>
> I'm running testing/unstable on Linux 2.6.18-3-k7, and onTimer isn't
> called on my system since the main thread receives SIGALRM and not the
> CiTimer thread. I can prevent this by using pthread_sigmask to block
> SIGALRM in main.
>
> sigset_t cancel, old;
> sigemptyset(&cancel);
> sigaddset(&cancel, SIGALRM);
>
> pthread_sigmask(SIG_BLOCK, &cancel, &old);
correct.
But this does not really fix the problem nor is it a usable workaround.
When you create 2 threads CiTimer and block the signal in the main
thread, one of the threads /the one you create first) produces a working
onTimer() output. The second thread never gets into the onTimer().
So in a normal application where more threads use timers this will not
help.
So it seems that there was a change maybe in how signals are delivered
to multithreaded applications which produces this bug.
regards
Mike
More information about the Pkg-voip-maintainers
mailing list