Real-time simulation of a water heater system in VxWorks C, using semaphores, mutexes, watchdogs, and multithreading.