I've found another small bug in my patch: After removing the pthread header from the gxx_wrapper.h in my second version of the patch I forgot to add it to gxx_wrapper.c. This is fixed in the appended new version of the third patch. Sorry for the additional mails.