Changeset 101990 in vbox for trunk/src/libs
- Timestamp:
- Nov 8, 2023 5:30:18 PM (15 months ago)
- svn:sync-xref-src-repo-rev:
- 160087
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/threads/plevent.c
r101981 r101990 52 52 #include "private/pprthred.h" 53 53 54 #include <iprt/assert.h> 54 55 #include <iprt/errcore.h> 55 56 static PRLogModuleInfo *event_lm = NULL; 56 #include <VBox/log.h> 57 57 58 58 /******************************************************************************* … … 118 118 PRMonitor* mon = NULL; 119 119 120 if (event_lm == NULL)121 event_lm = PR_NewLogModule("event");122 123 120 self = PR_NEWZAP(PLEventQueue); 124 121 if (self == NULL) return NULL; … … 248 245 return NULL; 249 246 250 PR_ASSERT(event != NULL);247 Assert(event != NULL); 251 248 252 249 if (PR_GetCurrentThread() == self->handlerThread) { … … 384 381 _pl_DestroyEventForOwner(PLEvent* event, void* owner, PLEventQueue* queue) 385 382 { 386 PR_ASSERT(PR_GetMonitorEntryCount(queue->monitor) > 0);383 Assert(PR_GetMonitorEntryCount(queue->monitor) > 0); 387 384 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)); 390 386 PL_DequeueEvent(event, queue); 391 387 … … 402 398 } 403 399 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)); 406 401 } 407 402 } … … 413 408 return; 414 409 415 PR_LOG(event_lm, PR_LOG_DEBUG, 416 ("$$$ revoking events for owner %0x", owner)); 410 Log(("$$$ revoking events for owner %0x", owner)); 417 411 418 412 /* … … 421 415 */ 422 416 PR_EnterMonitor(self->monitor); 423 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ owner %0x, entered monitor", owner));417 Log(("$$$ owner %0x, entered monitor", owner)); 424 418 425 419 /* … … 434 428 PLEvent* event = PR_EVENT_PTR(qp); 435 429 qp = qp->next; 436 PR_ASSERT(event->owner != owner);430 Assert(event->owner != owner); 437 431 } 438 432 } … … 441 435 PR_ExitMonitor(self->monitor); 442 436 443 PR_LOG(event_lm, PR_LOG_DEBUG, 444 ("$$$ revoking events for owner %0x", owner)); 437 Log(("$$$ revoking events for owner %0x", owner)); 445 438 } 446 439 … … 493 486 break; 494 487 495 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ processing event"));488 Log(("$$$ processing event")); 496 489 PL_HandleEvent(event); 497 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ done processing event"));490 Log(("$$$ done processing event")); 498 491 } 499 492 … … 553 546 554 547 /* 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)); 556 549 557 550 result = self->handler(self); … … 577 570 578 571 /* 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)); 580 573 581 574 if(self->condVar != NIL_RTSEMEVENT) … … 597 590 been processed and destroyed or not. */ 598 591 599 PR_ASSERT(queue->handlerThread == PR_GetCurrentThread());592 Assert(queue->handlerThread == PR_GetCurrentThread()); 600 593 601 594 PR_EnterMonitor(queue->monitor); 602 595 603 PR_ASSERT(!PR_CLIST_IS_EMPTY(&self->link));596 Assert(!PR_CLIST_IS_EMPTY(&self->link)); 604 597 605 598 #if 0 … … 645 638 while ((event = PL_GetEvent(self)) == NULL) { 646 639 PRStatus err; 647 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ waiting for event"));640 Log(("$$$ waiting for event")); 648 641 err = PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT); 649 642 if ((err == PR_FAILURE) … … 668 661 } 669 662 670 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ processing event"));663 Log(("$$$ processing event")); 671 664 PL_HandleEvent(event); 672 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ done processing event"));665 Log(("$$$ done processing event")); 673 666 } 674 667 } … … 760 753 # endif 761 754 762 PR_LOG(event_lm, PR_LOG_DEBUG, 763 ("_pl_NativeNotify: self=%p", 764 self)); 755 Log(("_pl_NativeNotify: self=%p", self)); 765 756 count = write(self->eventPipe[1], buf, 1); 766 757 if (count == 1) … … 789 780 PRInt32 count; 790 781 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)); 794 783 /* consume the byte NativeNotify put in our pipe: */ 795 784 count = read(self->eventPipe[0], &c, 1); … … 865 854 /* make a run loop source */ 866 855 eventQueue->mRunLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 0 /* order */, &sourceContext); 867 PR_ASSERT(eventQueue->mRunLoopSource);856 Assert(eventQueue->mRunLoopSource); 868 857 869 858 eventQueue->mMainRunLoop = CFRunLoopGetCurrent(); … … 913 902 */ 914 903 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)); 917 905 918 906 if (fullCount == 0) { … … 930 918 if (event == NULL) 931 919 break; 932 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event %ld\n", 933 event->id)); 920 Log(("$$$ processing event %ld\n", event->id)); 934 921 if (event->id >= aID) { 935 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ skipping event and breaking"));922 Log(("$$$ skipping event and breaking")); 936 923 break; 937 924 } … … 939 926 event = PL_GetEvent(aSelf); 940 927 PL_HandleEvent(event); 941 PR_LOG(event_lm, PR_LOG_DEBUG,("$$$ done processing event"));928 Log(("$$$ done processing event")); 942 929 count++; 943 930 }
Note:
See TracChangeset
for help on using the changeset viewer.