2. Write an XASMgr Application

Required custom application code.

Thread synchronization.

Required custom application code

Use amxasamxasamxassample.cpp as a template for writing your application. You will need to provide your own application code for:

main

OnInited

OnAlarmAck

OnAlarmClear

OnAlarmDel

OnShutdown

Thread Synchronization

Your implementation of CExternalAlarmManager will have to manage its own thread synchronization. The need for this synchronization will arise in situations where a callback method may need to access XASMgr specific structures at the same time the corresponding thread may need to access them.

The base internals have no knowledge of what you create, and cannot help out in this area. The responsibility for this synchronization rests completely with the XASMgr developer, and failure to deal with this issue by appropriate use of semaphores, mutexes or other Microsoft Win32 synchronization objects will likely result in an unreliable, unpredictable XASMgr implementation.

The sample program, as implemented, does not have need of or demonstrate these techniques. Please refer to Microsoft documentation and samples for management of multiple threads within a process potentially requiring simultaneous access to common data.

More information

External Alarm State Management getting started.