void* thr2 (void* arg) { while(!release_thr1); usecount = usecount + 1; if (locked) return 0; locked = 1; flag1 = 1; return 0; }