#include #include #include static int xxx(float f) { if(f <= 0.0){ printf("wrong f!: %f\n", f); return -1; } return 0; } static void *fun(void *arg) { float f = 5.0; for(;;){ if(xxx(f) < 0) abort(); } return NULL; } int main() { pthread_t t1, t2; pthread_create(&t1, NULL, fun, NULL); pthread_create(&t2, NULL, fun, NULL); pthread_join(t1, NULL); pthread_join(t2, NULL); return 0; }