Pthreads Programming by Bradford Nichols, Dick Buttlar, & Jacqueline Proulx Farrell This errata page lists errors outstanding in the most recent printing. If you have any technical questions or error reports, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was last updated on July 31. 2008. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: (iv) Printing History near top of page; The printing history has not been updated. My copy contains corrections for all the errata reported to have been made for the 1/00 reprint, but the last entry under Printing History is "February 1998: Minor corrections". (15) line 3; "and using the (void *) cast to quit the compiler." should be: "and using the (void *) cast to quiet the compiler." {23} Example 1-8; At the top of the code example, internal_error is declared but not used. static const int internal_error = -12; should be: static const int real_bad_error = -12; (38) 4th paragraph; Instead of "for a such a", it should be "for such a" [80] There is a bug with respect to condition variables. There is a race condition. If you don't make sure that the watch_count() routine has started waiting for the condition to be set before you signal the condition, the condition may be signaled before the watch_count() function starts waiting. That is, suppose the inc_count()) threads run and signal the condition *before* the first "9781565921153_mutex_lock(&count _mutex)" call in watch_count() is even executed. The condition will be ignored. While this is unlikely, it is possible. You can solve this problem by having the main thread not even spawn the inc_count() threads until it receives notice that watch_count() has executed "9781565921153_mutex_lock(&count_mutex)" already. [105] Example 3-26; When freeing the pool structures, the while loops reads: while(tpool->queue_head != NULL) { cur_nodep = tpool->queue_head->next; tpool->queue_head = tpool->queue_head->next; free(cur_nodep); } This is freeing the incorrect structure. Instead, it should be: while(tpool->queue_head != NULL) { cur_nodep = tpool->queue_head; /* HERE IS THE DIFFERENCE */ tpool->queue_head = tpool->queue_head->next; free(cur_nodep); }