Changeset 26 for trunk/threads-tsl.c
- Timestamp:
- Apr 18, 2014, 8:10:14 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/threads-tsl.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/threads-tsl.c
r15 r26 1 1 /* Copyright (C) 2009 by Mattia Monga <mattia.monga@unimi.it> */ 2 2 /* $Id$ */ 3 #define _GNU_SOURCE 3 4 4 5 #include <unistd.h> … … 18 19 printf("Processo figlio (%d). s = %d\n", 19 20 getpid(), shared[0]); 21 fflush(stdout); 20 22 if (!(shared[0] < 10)){ 21 23 printf("Corsa critica!!!!\n"); … … 25 27 leave_section(&shared[1]); 26 28 sched_yield(); 29 usleep(50); 27 30 } 28 31 leave_section(&shared[1]); // il test nel while \`e dopo enter\_section … … 71 74 shared[2], 72 75 shared[3]); 76 fflush(stdout); 73 77 } 74 78 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.