- lock_acquire (t->lock);
- old_product = *t->product;
- *t->product = new_product;
- lock_release (t->lock);
-
- printf ("%s: duration=%d, iteration=%d, product=%d\n",
- thread_name (), t->duration, i, new_product);
-
- if (old_product > new_product)
- printf ("%s: Out of order sleep completion (%d > %d)!\n",
- thread_name (), old_product, new_product);
+ lock_acquire (&test->output_lock);
+ *test->output_pos++ = t->id;
+ lock_release (&test->output_lock);