BUGS

* bp_connection_destroy

blw_mem_cleanup causes a pagefault
patched but needs a better fix.

* poll_node_free

free(pn->iostateindex) causes a pagefault
patched but needs a better fix.


IMPROVEMENTS

* rework connection shutdown to handle connection abort and tuning reset cleanly (e.g.  shutdown_callback)

This function is used to indicate serveral different states from the transport (ready for tuning, connection aborted, connection stopped) but it doesn't account for all of the different events. This code could be cleaned up.

* replace CHANNEL_INSTANCE.sem_callback with an event queue

Currently the library uses a semaphore to prevent multiple parallel callbacks for the same channel. If this were replaced with an queue for the callbacks the number of threads in the system could be further reduced.

* new thread creation policy

The thread creation policy creates a new thread anytime there is work to be done and no thread is available. This policy could be improved to reduce the number of threads started. One thing to consider is that there are places in the code that block waiting for a callback so a policy with just a maximum number of threads could cause a deadlock.

* bp_connection_destroy

protect race condition with connection close

* fix tuning reset to handle sasl encryption tuning resets
