//*************************************************************** // From the book "Win32 System Services: The Heart of Windows 98 // and Windows 2000" // by Marshall Brain // Published by Prentice Hall // // Copyright 1995, by Prentice Hall. // // This code demonstrates the use of a mutex to synchronize // threads. //*************************************************************** // mutex.cpp #include #include #include volatile INT count; HANDLE mutex; void CountThread(INT iterations) { INT i; INT x; for (i=0; i