//*************************************************************** // 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 how separate threads can open // a mutex. Compare to mutex.cpp. //*************************************************************** // mutex2.cpp #include #include #include volatile INT count; void CountThread(INT iterations) { INT i; INT x; HANDLE mutex; mutex = CreateMutex(0, FALSE, "counterMutex"); for (i=0; i