MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / AddWatcher

Method AddWatcher

cpp/src/platform/winRT/WaitImpl.cpp:64–87  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Add a watcher to our object. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

62// Add a watcher to our object.
63//-----------------------------------------------------------------------------
64void WaitImpl::AddWatcher
65(
66 Wait::pfnWaitNotification_t _callback,
67 void* _context
68)
69{
70 // Add the watcher to our list
71 Watcher watcher;
72 watcher.m_callback = _callback;
73 watcher.m_context = _context;
74
75 EnterCriticalSection( &m_criticalSection );
76
77 m_watchers.push_back( watcher );
78
79 LeaveCriticalSection( &m_criticalSection );
80
81 // If the object is already in a signalled state, notify the watcher immediately
82 if( m_owner->IsSignalled() )
83 {
84 _callback( _context );
85 }
86
87}
88
89//-----------------------------------------------------------------------------
90// <WaitImpl::RemoveWatcher>

Callers

nothing calls this directly

Calls 1

IsSignalledMethod · 0.45

Tested by

no test coverage detected