Changeset 86626 in vbox for trunk/src/VBox
- Timestamp:
- Oct 19, 2020 10:42:10 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstIprtList.cpp
r86619 r86626 490 490 #define MTTEST_ITEMS_NOT_REMOVED 100 491 491 492 static RTSEMEVENTMULTI g_hEvtMtTest = NIL_RTSEMEVENTMULTI; 493 492 494 /** 493 495 * Thread for prepending items to a shared list. … … 500 502 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 501 503 RT_NOREF_PV(hSelf); 504 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 502 505 503 506 /* Prepend new items at the start of the list. */ … … 518 521 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 519 522 RT_NOREF_PV(hSelf); 523 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 520 524 521 525 /* Append new items at the end of the list. */ … … 531 535 uint32_t cItems = (uint32_t)pTestList->size(); 532 536 if (cItems > MTTEST_ITEMS) 537 { 533 538 cItems -= MTTEST_ITEMS; 534 if (cItems < MTTEST_ITEMS_NOT_REMOVED) 539 if (cItems < MTTEST_ITEMS_NOT_REMOVED) 540 cItems = MTTEST_ITEMS_NOT_REMOVED; 541 } 542 else if (cItems > MTTEST_ITEMS_NOT_REMOVED) 535 543 cItems = MTTEST_ITEMS_NOT_REMOVED; 544 else if (cItems <= 1) 545 return 0; 536 546 return RTRandU32Ex(0, cItems - 1); 537 547 } … … 547 557 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 548 558 RT_NOREF_PV(hSelf); 559 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 549 560 550 561 /* Insert new items in the middle of the list. */ … … 565 576 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 566 577 RT_NOREF_PV(hSelf); 578 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 567 579 568 580 MTTEST_TYPE a; … … 589 601 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 590 602 RT_NOREF_PV(hSelf); 603 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 591 604 592 605 /* Try to replace C items from random places. */ … … 612 625 MTTEST_LIST_TYPE<MTTEST_TYPE> *pTestList = (MTTEST_LIST_TYPE<MTTEST_TYPE> *)pvUser; 613 626 RT_NOREF_PV(hSelf); 627 RTSemEventMultiWait(g_hEvtMtTest, RT_MS_1MIN); 614 628 615 629 /* Try to delete items from random places. */ … … 641 655 }; 642 656 657 RTTESTI_CHECK_RC_RETV(RTSemEventMultiCreate(&g_hEvtMtTest), VINF_SUCCESS); 658 643 659 for (unsigned i = 0; i < RT_ELEMENTS(ahThreads); i++) 644 660 { … … 647 663 } 648 664 649 uint64_t tsMsDeadline = RTTimeMilliTS() + 60000; 665 RTTESTI_CHECK_RC(RTSemEventMultiSignal(g_hEvtMtTest), VINF_SUCCESS); 666 uint64_t tsMsDeadline = RTTimeMilliTS() + RT_MS_1MIN; 650 667 for (unsigned i = 0; i < RT_ELEMENTS(ahThreads); i++) 651 668 { … … 654 671 RTTESTI_CHECK_RC(RTThreadWait(ahThreads[i], cWait, NULL), VINF_SUCCESS); 655 672 } 673 RTTESTI_CHECK_RC(RTSemEventMultiDestroy(g_hEvtMtTest), VINF_SUCCESS); 674 g_hEvtMtTest = NIL_RTSEMEVENTMULTI; 656 675 657 676 RTTESTI_CHECK_RETV(testList.size() == MTTEST_ITEMS * 2);
Note:
See TracChangeset
for help on using the changeset viewer.