----------------------------------------------------------------------------- Notify all the watchers that the object has become signalled -----------------------------------------------------------------------------
| 141 | // Notify all the watchers that the object has become signalled |
| 142 | //----------------------------------------------------------------------------- |
| 143 | void WaitImpl::Notify |
| 144 | ( |
| 145 | ) |
| 146 | { |
| 147 | if( pthread_mutex_lock( &m_criticalSection ) != 0 ) |
| 148 | { |
| 149 | fprintf(stderr, "WaitImpl::Notify lock error %d\n", errno ); |
| 150 | assert( 0 ); |
| 151 | } |
| 152 | for( list<Watcher>::iterator it=m_watchers.begin(); it!=m_watchers.end(); ++it ) |
| 153 | { |
| 154 | Watcher const& watcher = *it; |
| 155 | watcher.m_callback( watcher.m_context ); |
| 156 | } |
| 157 | if( pthread_mutex_unlock( &m_criticalSection ) != 0 ) |
| 158 | { |
| 159 | fprintf(stderr, "WaitImpl::Notify unlock error %d\n", errno ); |
| 160 | assert( 0 ); |
| 161 | } |
| 162 | } |