466f31e55b
channel at a time unless it is actually necessary to lock both. This avoids problems with lock order reversal and malloc() calls with a mutex held when lower level code unlocks a channel, calls malloc(), and relocks the channel. This also avoids the cost of some unnecessary locking and unlocking. Tested by: matk