Changeset 102459 in vbox
- Timestamp:
- Dec 5, 2023 8:12:45 AM (12 months ago)
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Makefile.kmk
r102458 r102459 156 156 nsprpub/lib/ds/plhash.h \ 157 157 nsprpub/pr/include/prbit.h \ 158 nsprpub/pr/include/prclist.h \159 158 nsprpub/pr/include/prinrval.h \ 160 159 nsprpub/pr/include/prlong.h \ -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/nspr.h
r102392 r102459 44 44 45 45 #include "prbit.h" 46 #include "prclist.h"47 46 #include "prinrval.h" 48 47 #include "prlong.h" -
trunk/src/libs/xpcom18a4/xpcom/threads/plevent.c
r102392 r102459 70 70 struct PLEventQueue { 71 71 const char* name; 72 PRCListqueue;72 RTLISTANCHOR queue; 73 73 PRMonitor* monitor; 74 74 RTTHREAD handlerThread; … … 129 129 self->notified = PR_FALSE; 130 130 131 PR_INIT_CLIST(&self->queue);131 RTListInit(&self->queue); 132 132 if ( qtype == EventQueueIsNative ) { 133 133 err = _pl_SetupNativeNotifier(self); … … 212 212 /* insert event into thread's event queue: */ 213 213 if (event != NULL) { 214 PR_APPEND_LINK(&event->link, &self->queue);214 RTListAppend(&self->queue, &event->link); 215 215 } 216 216 … … 319 319 PR_EnterMonitor(self->monitor); 320 320 321 if (! PR_CLIST_IS_EMPTY(&self->queue)) {321 if (!RTListIsEmpty(&self->queue)) { 322 322 if ( self->type == EventQueueIsNative && 323 323 self->notified && … … 332 332 333 333 /* then grab the event and return it: */ 334 event = PR_EVENT_PTR(self->queue.next); 335 PR_REMOVE_AND_INIT_LINK(&event->link); 334 event = RTListGetFirst(&self->queue, PLEvent, link); 335 RTListNodeRemove(&event->link); 336 RTListInit(&event->link); 336 337 } 337 338 … … 351 352 PR_EnterMonitor(self->monitor); 352 353 353 if (! PR_CLIST_IS_EMPTY(&self->queue))354 if (!RTListIsEmpty(&self->queue)) 354 355 result = PR_TRUE; 355 356 … … 361 362 PL_MapEvents(PLEventQueue* self, PLEventFunProc fun, void* data) 362 363 { 363 PRCList* qp;364 365 364 if (self == NULL) 366 365 return; 367 366 368 367 PR_EnterMonitor(self->monitor); 369 qp = self->queue.next; 370 while (qp != &self->queue) { 371 PLEvent* event = PR_EVENT_PTR(qp); 372 qp = qp->next; 373 (*fun)(event, data, self); 368 PLEvent *pIt, *pItNext; 369 RTListForEachSafe(&self->queue, pIt, pItNext, PLEvent, link) 370 { 371 (*fun)(pIt, data, self); 374 372 } 375 373 PR_ExitMonitor(self->monitor); … … 422 420 #ifdef DEBUG 423 421 { 424 PRCList* qp = self->queue.next; 425 while (qp != &self->queue) { 426 PLEvent* event = PR_EVENT_PTR(qp); 427 qp = qp->next; 428 Assert(event->owner != owner); 422 PLEvent *pIt; 423 RTListForEach(&self->queue, pIt, PLEvent, link) 424 { 425 Assert(pIt->owner != owner); 429 426 } 430 427 } … … 439 436 _pl_GetEventCount(PLEventQueue* self) 440 437 { 441 PRCList* node;442 438 PRInt32 count = 0; 443 439 444 440 PR_EnterMonitor(self->monitor); 445 node = PR_LIST_HEAD(&self->queue); 446 while (node != &self->queue) { 441 PLEvent *pIt; 442 RTListForEach(&self->queue, pIt, PLEvent, link) 443 { 447 444 count++; 448 node = PR_NEXT_LINK(node);449 445 } 450 446 PR_ExitMonitor(self->monitor); … … 518 514 PLDestroyEventProc destructor) 519 515 { 520 PR_INIT_CLIST(&self->link);516 RTListInit(&self->link); 521 517 self->handler = handler; 522 518 self->destructor = destructor; … … 544 540 545 541 /* This event better not be on an event queue anymore. */ 546 Assert( PR_CLIST_IS_EMPTY(&self->link));542 Assert(RTListIsEmpty(&self->link)); 547 543 548 544 result = self->handler(self); … … 568 564 569 565 /* This event better not be on an event queue anymore. */ 570 Assert( PR_CLIST_IS_EMPTY(&self->link));566 Assert(RTListIsEmpty(&self->link)); 571 567 572 568 if(self->condVar != NIL_RTSEMEVENT) … … 592 588 PR_EnterMonitor(queue->monitor); 593 589 594 Assert(! PR_CLIST_IS_EMPTY(&self->link));590 Assert(!RTListIsEmpty(&self->link)); 595 591 596 592 #if 0 … … 604 600 #endif 605 601 606 PR_REMOVE_AND_INIT_LINK(&self->link); 602 RTListNodeRemove(&self->link); 603 RTListInit(&self->link); 607 604 608 605 PR_ExitMonitor(queue->monitor); -
trunk/src/libs/xpcom18a4/xpcom/threads/plevent.h
r102238 r102459 186 186 187 187 #include "prtypes.h" 188 #include "prclist.h"189 188 #include "prmon.h" 190 189 191 190 #include <iprt/critsect.h> 191 #include <iprt/list.h> 192 192 #include <iprt/semaphore.h> 193 193 #include <iprt/thread.h> … … 522 522 523 523 struct PLEvent { 524 PRCListlink;524 RTLISTNODE link; 525 525 PLHandleEventProc handler; 526 526 PLDestroyEventProc destructor;
Note:
See TracChangeset
for help on using the changeset viewer.