1.3.27 with NPTL: (wapd) always crashes at shutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ville Skytt? wrote:
> The culprit seems to be cWapServer::Action() in server.c, which I tried
> to convert to use cCondWait::SleepMs() instead of usleep(), and added an
> "active" boolean into the class that would control the while loop in
> Action() and that would be set to false in the destructor, but those
> changes did not help.

(without taking any close look at the source code)
I assume this is a main while loop in a cThread. Stopping a thread from
within the destructor is quite risky, as the object is already partially
destructed, and if you dont explicitly wait for the thread to finish,
the object may be gone before the thread ends.

The best way is to stop the thread before the object gets destroyed,
using some thread.Stop(). The right place for stopping threads is in
cPlugin::Stop().

Cheers,

Udo


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux