Agents will not start In case of ...
- ... multiple agents running on the same Windows host...
- ... in the same session (e.g. the same user or as a service) ...
- ... if one of them fails or is closed while it has acquired some lock (for example logging lock).
- full system reboot;
- closing all Zabbix agents running in the affected session, waiting for Windows to remove the unused lock, then starting agents again.
__zbx_mutex_lock() doesn't handle explicitly the WAIT_ABANDONED result from WaitForSingleObject() but instead exits.
More info on mutexes in Windows.
- lock namespaces are per-session (session 0 for services, other sessions - for users);
- contrary to SysV locks - Windows keeps track of users and removes the lock if it's unreferenced by any thread in the session.