libdispatch does not free all resources when dlclose() is called
Portable implementation of Grand Central Dispatch
Brought to you by:
mheily
libdispatch does not free all resources when dlclose() is called. This causes a segfault if you call dlopen() again, because it tries to reinitialize pthread keys.
See the attached patch for a solution. I think we should consider using attribute((destructor)) and attribute((constructor)) to eliminate the need for the user to call libdispatch_init() or libdispatch_deinit().
patch attached, based on a mailing list post