IF (SemoP (SemID, & Ops, 1)) == - 1) // Wait for the read signal to 0 {Printf ("Semwait Error / N"); return 0;} IF ((SEMOP (SEMID, & Wacquire, 1) ) == - 1) // write signal plus 1 {Printf ("Semacquire Error / N"); return 0;}
If there is a pre-writing signal, the read signal has changed to 0, so that there is a problem,
The solution is: release signal