VirtualBox

Changeset 101990 in vbox for trunk/src/libs


Ignore:
Timestamp:
Nov 8, 2023 5:30:18 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160087
Message:

libs/xpcom: Convert plevent.c from PR_LOG to IPRT's logging infrastructure, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/threads/plevent.c

    r101981 r101990  
    5252#include "private/pprthred.h"
    5353
     54#include <iprt/assert.h>
    5455#include <iprt/errcore.h>
    55 
    56 static PRLogModuleInfo *event_lm = NULL;
     56#include <VBox/log.h>
    5757
    5858/*******************************************************************************
     
    118118    PRMonitor* mon = NULL;
    119119
    120     if (event_lm == NULL)
    121         event_lm = PR_NewLogModule("event");
    122 
    123120    self = PR_NEWZAP(PLEventQueue);
    124121    if (self == NULL) return NULL;
     
    248245        return NULL;
    249246
    250     PR_ASSERT(event != NULL);
     247    Assert(event != NULL);
    251248
    252249    if (PR_GetCurrentThread() == self->handlerThread) {
     
    384381_pl_DestroyEventForOwner(PLEvent* event, void* owner, PLEventQueue* queue)
    385382{
    386     PR_ASSERT(PR_GetMonitorEntryCount(queue->monitor) > 0);
     383    Assert(PR_GetMonitorEntryCount(queue->monitor) > 0);
    387384    if (event->owner == owner) {
    388         PR_LOG(event_lm, PR_LOG_DEBUG,
    389                ("$$$ \tdestroying event %0x for owner %0x", event, owner));
     385        Log(("$$$ \tdestroying event %0x for owner %0x", event, owner));
    390386        PL_DequeueEvent(event, queue);
    391387
     
    402398    }
    403399    else {
    404         PR_LOG(event_lm, PR_LOG_DEBUG,
    405                ("$$$ \tskipping event %0x for owner %0x", event, owner));
     400        Log(("$$$ \tskipping event %0x for owner %0x", event, owner));
    406401    }
    407402}
     
    413408        return;
    414409
    415     PR_LOG(event_lm, PR_LOG_DEBUG,
    416          ("$$$ revoking events for owner %0x", owner));
     410    Log(("$$$ revoking events for owner %0x", owner));
    417411
    418412    /*
     
    421415    */
    422416    PR_EnterMonitor(self->monitor);
    423     PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ owner %0x, entered monitor", owner));
     417    Log(("$$$ owner %0x, entered monitor", owner));
    424418
    425419    /*
     
    434428            PLEvent* event = PR_EVENT_PTR(qp);
    435429            qp = qp->next;
    436             PR_ASSERT(event->owner != owner);
     430            Assert(event->owner != owner);
    437431        }
    438432    }
     
    441435    PR_ExitMonitor(self->monitor);
    442436
    443     PR_LOG(event_lm, PR_LOG_DEBUG,
    444            ("$$$ revoking events for owner %0x", owner));
     437    Log(("$$$ revoking events for owner %0x", owner));
    445438}
    446439
     
    493486            break;
    494487
    495         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event"));
     488        Log(("$$$ processing event"));
    496489        PL_HandleEvent(event);
    497         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));
     490        Log(("$$$ done processing event"));
    498491    }
    499492
     
    553546
    554547    /* This event better not be on an event queue anymore. */
    555     PR_ASSERT(PR_CLIST_IS_EMPTY(&self->link));
     548    Assert(PR_CLIST_IS_EMPTY(&self->link));
    556549
    557550    result = self->handler(self);
     
    577570
    578571    /* This event better not be on an event queue anymore. */
    579     PR_ASSERT(PR_CLIST_IS_EMPTY(&self->link));
     572    Assert(PR_CLIST_IS_EMPTY(&self->link));
    580573
    581574    if(self->condVar != NIL_RTSEMEVENT)
     
    597590       been processed and destroyed or not. */
    598591
    599     PR_ASSERT(queue->handlerThread == PR_GetCurrentThread());
     592    Assert(queue->handlerThread == PR_GetCurrentThread());
    600593
    601594    PR_EnterMonitor(queue->monitor);
    602595
    603     PR_ASSERT(!PR_CLIST_IS_EMPTY(&self->link));
     596    Assert(!PR_CLIST_IS_EMPTY(&self->link));
    604597
    605598#if 0
     
    645638    while ((event = PL_GetEvent(self)) == NULL) {
    646639        PRStatus err;
    647         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ waiting for event"));
     640        Log(("$$$ waiting for event"));
    648641        err = PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
    649642        if ((err == PR_FAILURE)
     
    668661        }
    669662
    670         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event"));
     663        Log(("$$$ processing event"));
    671664        PL_HandleEvent(event);
    672         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));
     665        Log(("$$$ done processing event"));
    673666    }
    674667}
     
    760753# endif
    761754
    762     PR_LOG(event_lm, PR_LOG_DEBUG,
    763            ("_pl_NativeNotify: self=%p",
    764             self));
     755    Log(("_pl_NativeNotify: self=%p", self));
    765756    count = write(self->eventPipe[1], buf, 1);
    766757    if (count == 1)
     
    789780    PRInt32 count;
    790781    unsigned char c;
    791     PR_LOG(event_lm, PR_LOG_DEBUG,
    792             ("_pl_AcknowledgeNativeNotify: self=%p",
    793              self));
     782    Log(("_pl_AcknowledgeNativeNotify: self=%p", self));
    794783    /* consume the byte NativeNotify put in our pipe: */
    795784    count = read(self->eventPipe[0], &c, 1);
     
    865854    /* make a run loop source */
    866855    eventQueue->mRunLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 0 /* order */, &sourceContext);
    867     PR_ASSERT(eventQueue->mRunLoopSource);
     856    Assert(eventQueue->mRunLoopSource);
    868857
    869858    eventQueue->mMainRunLoop = CFRunLoopGetCurrent();
     
    913902     */
    914903    fullCount = _pl_GetEventCount(aSelf);
    915     PR_LOG(event_lm, PR_LOG_DEBUG,
    916            ("$$$ fullCount is %d id is %ld\n", fullCount, aID));
     904    Log(("$$$ fullCount is %d id is %ld\n", fullCount, aID));
    917905
    918906    if (fullCount == 0) {
     
    930918        if (event == NULL)
    931919            break;
    932         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event %ld\n",
    933                                         event->id));
     920        Log(("$$$ processing event %ld\n", event->id));
    934921        if (event->id >= aID) {
    935             PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ skipping event and breaking"));
     922            Log(("$$$ skipping event and breaking"));
    936923            break;
    937924        }
     
    939926        event = PL_GetEvent(aSelf);
    940927        PL_HandleEvent(event);
    941         PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));
     928        Log(("$$$ done processing event"));
    942929        count++;
    943930    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette