---------------------------------------------------------------------
| 148 | } |
| 149 | //--------------------------------------------------------------------- |
| 150 | void DefaultWorkQueueBase::removeRequestHandler( uint16 channel, RequestHandler *rh ) |
| 151 | { |
| 152 | OGRE_LOCK_RW_MUTEX_WRITE( mRequestHandlerMutex ); |
| 153 | |
| 154 | RequestHandlerListByChannel::iterator i = mRequestHandlers.find( channel ); |
| 155 | if( i != mRequestHandlers.end() ) |
| 156 | { |
| 157 | RequestHandlerList &handlers = i->second; |
| 158 | for( RequestHandlerList::iterator j = handlers.begin(); j != handlers.end(); ++j ) |
| 159 | { |
| 160 | if( ( *j )->getHandler() == rh ) |
| 161 | { |
| 162 | // Disconnect - this will make it safe across copies of the list |
| 163 | // this is threadsafe and will wait for existing processes to finish |
| 164 | ( *j )->disconnectHandler(); |
| 165 | handlers.erase( j ); |
| 166 | break; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | //--------------------------------------------------------------------- |
| 172 | void DefaultWorkQueueBase::addResponseHandler( uint16 channel, ResponseHandler *rh ) |
| 173 | { |
no test coverage detected