MessageQueue::~MessageQueue() { // ATTN-A: thread safety! PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::~MessageQueue()"); Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3, "MessageQueue::~MessageQueue queueId = %i, name = %s", _queueId, _name); { AutoMutex autoMut(q_table_mut); _queueTable.remove(_queueId); } // mutex unlocks here // Free the name: delete [] _name; while(_front) { Message* tmp = _front; _front = _front->_next; delete tmp; } PEG_METHOD_EXIT(); }
MessageQueue::~MessageQueue() { // ATTN-A: thread safety! PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::~MessageQueue()"); PEG_TRACE((TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3, "MessageQueue::~MessageQueue queueId = %i, name = %s", _queueId, _name)); { AutoMutex autoMut(q_table_mut); _queueTable.remove(_queueId); } // mutex unlocks here // Free the name: delete [] _name; // Return the queue id. putQueueId(_queueId); PEG_METHOD_EXIT(); }
void MessageQueue::remove_myself(Uint32 qid) { AutoMutex autoMut(q_table_mut); _queueTable.remove(qid); }