port to new glib thread API