|
1 | 1 | /* |
2 | | - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -213,9 +213,10 @@ TEST_VM(ThreadsListHandle, sanity) { |
213 | 213 |
|
214 | 214 | // Test case: after first nested ThreadsListHandle (tlh2) has been destroyed |
215 | 215 |
|
216 | | - // Verify the current thread refers to tlh1: |
217 | | - EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), tlh1.list()) |
218 | | - << "thr->_threads_hazard_ptr must match tlh1.list()"; |
| 216 | + // Verify the current thread's hazard ptr is NULL: |
| 217 | + EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), (ThreadsList*)NULL) |
| 218 | + << "thr->_threads_hazard_ptr must be NULL"; |
| 219 | + // Verify the current thread's threads list ptr refers to tlh1: |
219 | 220 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_list_ptr(thr), list_ptr1) |
220 | 221 | << "thr->_threads_list_ptr must match list_ptr1"; |
221 | 222 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_nested_threads_hazard_ptr_cnt(thr), (uint)0) |
@@ -396,9 +397,10 @@ TEST_VM(ThreadsListHandle, sanity) { |
396 | 397 |
|
397 | 398 | // Test case: after double nested ThreadsListHandle (tlh3) has been destroyed |
398 | 399 |
|
399 | | - // Verify the current thread refers to tlh2: |
400 | | - EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), tlh2.list()) |
401 | | - << "thr->_threads_hazard_ptr must match tlh2.list()"; |
| 400 | + // Verify the current thread's hazard ptr is NULL: |
| 401 | + EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), (ThreadsList*)NULL) |
| 402 | + << "thr->_threads_hazard_ptr must be NULL"; |
| 403 | + // Verify the current thread's threads list ptr refers to tlh2: |
402 | 404 | EXPECT_EQ(tlh1.list(), tlh2.list()) |
403 | 405 | << "tlh1.list() must match tlh2.list()"; |
404 | 406 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_list_ptr(thr), list_ptr2) |
@@ -443,9 +445,10 @@ TEST_VM(ThreadsListHandle, sanity) { |
443 | 445 |
|
444 | 446 | // Test case: after first nested ThreadsListHandle (tlh2) has been destroyed |
445 | 447 |
|
446 | | - // Verify the current thread refers to tlh1: |
447 | | - EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), tlh1.list()) |
448 | | - << "thr->_threads_hazard_ptr must match tlh1.list()"; |
| 448 | + // Verify the current thread's hazard ptr is NULL: |
| 449 | + EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), (ThreadsList*)NULL) |
| 450 | + << "thr->_threads_hazard_ptr must be NULL"; |
| 451 | + // Verify the current thread's threads list ptr refers to tlh1: |
449 | 452 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_list_ptr(thr), list_ptr1) |
450 | 453 | << "thr->_threads_list_ptr must match list_ptr1"; |
451 | 454 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_nested_threads_hazard_ptr_cnt(thr), (uint)0) |
@@ -562,9 +565,10 @@ TEST_VM(ThreadsListHandle, sanity) { |
562 | 565 |
|
563 | 566 | // Test case: after first back-to-back nested ThreadsListHandle (tlh2a) has been destroyed |
564 | 567 |
|
565 | | - // Verify the current thread refers to tlh1: |
566 | | - EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), tlh1.list()) |
567 | | - << "thr->_threads_hazard_ptr must match tlh1.list()"; |
| 568 | + // Verify the current thread's hazard ptr is NULL: |
| 569 | + EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), (ThreadsList*)NULL) |
| 570 | + << "thr->_threads_hazard_ptr must be NULL"; |
| 571 | + // Verify the current thread's threads list ptr refers to tlh1: |
568 | 572 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_list_ptr(thr), list_ptr1) |
569 | 573 | << "thr->_threads_list_ptr must match list_ptr1"; |
570 | 574 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_nested_threads_hazard_ptr_cnt(thr), (uint)0) |
@@ -639,9 +643,10 @@ TEST_VM(ThreadsListHandle, sanity) { |
639 | 643 |
|
640 | 644 | // Test case: after second back-to-back nested ThreadsListHandle (tlh2b) has been destroyed |
641 | 645 |
|
642 | | - // Verify the current thread refers to tlh1: |
643 | | - EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), tlh1.list()) |
644 | | - << "thr->_threads_hazard_ptr must match tlh1.list()"; |
| 646 | + // Verify the current thread's hazard ptr is NULL: |
| 647 | + EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_hazard_ptr(thr), (ThreadsList*)NULL) |
| 648 | + << "thr->_threads_hazard_ptr must be NULL"; |
| 649 | + // Verify the current thread's threads list ptr refers to tlh1: |
645 | 650 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_threads_list_ptr(thr), list_ptr1) |
646 | 651 | << "thr->_threads_list_ptr must match list_ptr1"; |
647 | 652 | EXPECT_EQ(ThreadsListHandleTest::get_Thread_nested_threads_hazard_ptr_cnt(thr), (uint)0) |
|
0 commit comments