Am I correct in assuming this is not going to work as expected? The compiler might not even instantiate the lock given this code?
{
// Enqueue the notification to be processed
scoped_lock locked(m_notifications.lock);
m_notifications.sources->push(note);
}