from http://svn.macosforge.org/repository/libdispatch