- Timestamp:
- Apr 22, 2011, 9:37:36 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pthreads-pc.c
r2 r8 55 55 pthread_mutex_lock(&lock); 56 56 57 if(count == N) pthread_cond_wait(&full, &lock);57 while (count == N) pthread_cond_wait(&full, &lock); 58 58 buffer[count++] = o; 59 59 if (count == 1) pthread_cond_signal(&empty); … … 67 67 pthread_mutex_lock(&lock); 68 68 69 if(count == 0) pthread_cond_wait(&empty, &lock);69 while (count == 0) pthread_cond_wait(&empty, &lock); 70 70 *result = buffer[--count]; 71 71 if (count == N-1) pthread_cond_signal(&full);
Note:
See TracChangeset
for help on using the changeset viewer.