Prevent a xenagent timeout (and live kernel dump) on S3/S4 transition by
changing CXenIfaceCreator::Log to use TryEnterCriticalSection.
Otherwise, a timeout occurs when the service control handler fails to
return due to attempting to enter a critical section object that the
main service thread already owns while responding to the
control/shutdown xenstore watch.
Signed-off-by: Troy Crosley <troycrosley@gmail.com>
[Re-ordered if statement]
Signed-off-by: Paul Durrant <paul@xen.org>
void CXenIfaceCreator::Log(const char* message)
{
// if possible, send to xeniface to forward to logs
- CCritSec crit(&m_crit);
- if (m_device) {
+ if (m_device && TryEnterCriticalSection(&m_crit)) {
m_device->Log(message);
+ LeaveCriticalSection(&m_crit);
}
}