[chan_lcr] Unloading chan_lcr is now possible
authorAndreas Eversberg <jolly@eversberg.eu>
Thu, 24 Feb 2011 07:59:17 +0000 (08:59 +0100)
committerAndreas Eversberg <jolly@eversberg.eu>
Thu, 24 Feb 2011 07:59:17 +0000 (08:59 +0100)
commit03f26ba38638051d153db96ce158f220a6746d22
tree6dd9726c1f0f561cb736651eec229ffc34665918
parent7798beeab23fa282d4a510c53d5f95ed3f8c2366
[chan_lcr] Unloading chan_lcr is now possible

Hi,

I tried to tackle the issue that 'core stop|restart when convenient' won't
work because unloading chan_lcr does not work.

The issue is that the thread blocks in select().

I tried to move the clean-up work from after the main select loop to the
module unloading code, make that loop a real infinite loop and replaced
pthread_join() by pthred_cancel().

The result seems to work.
Proposed patch attached.

Unloading chan_lcr while it has open channels is fatal, with or without
that patch.

   Greetings,
     WIMPy
chan_lcr.c