nengo

Untitled

May 24th, 2020 (edited)
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. /* Barrera SENSE-REVERSING */
  2. void Sensebarrier(int *local_sense) /* local al hilo */
  3. {
  4. *local_sense = !(*local_sense);
  5. LOCK(pidlock_sr);
  6. counter++;
  7. if (counter == PROC_MAX) {
  8. counter = 0;
  9. UNLOCK(pidlock_sr);
  10. release = *local_sense;
  11. }
  12. else {
  13. UNLOCK(pidlock_sr);
  14. while (*local_sense != release);
  15. }
  16. }
Add Comment
Please, Sign In to add comment