Esempio n. 1
0
MessageQueue::MessageQueue(const char* name)
   : _queueId(getNextQueueId())
{
    //
    // Copy the name:
    //

    PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::MessageQueue()");

    if (!name)
    {
        name = "";
    }

    _name = new char[strlen(name) + 1];
    strcpy(_name, name);

    PEG_TRACE((TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3,
        "MessageQueue::MessageQueue  name = %s, queueId = %u", name, _queueId));

    //
    // Insert into queue table:
    //
    AutoMutex autoMut(q_table_mut);
    while (!_queueTable.insert(_queueId, this))
        ;

    PEG_METHOD_EXIT();
}
Esempio n. 2
0
MessageQueue::MessageQueue(
    const char* name,
    Boolean async,
    Uint32 queueId)
   : _queueId(queueId), _capabilities(0), _count(0), _front(0), _back(0), _async(async)
{
    //
    // Copy the name:
    //

    PEG_METHOD_ENTER(TRC_MESSAGEQUEUESERVICE,"MessageQueue::MessageQueue()");

    if (!name)
        name = "";

    _name = new char[strlen(name) + 1];
    strcpy(_name, name);

    Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL3,
        "MessageQueue::MessageQueue  name = %s, queueId = %u", name, queueId);

    //
    // Insert into queue table:
    //
    AutoMutex autoMut(q_table_mut);
    while (!_queueTable.insert(_queueId, this))
        ;

    PEG_METHOD_EXIT();
}