this is the implementation for pthreads. if we need to test for WIN32 here, something must have gone completely wrong :)