X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=test%2Fstress%2Fsequential%2Fsequential-misc%2Fspinlock_driver.cpp;h=6dce8121dfe241c7f6071ba4e0b59bfefa5aca1c;hp=99a48153e39e9210df053e234f73f557e375e953;hb=6ec1165b0c929f8b4c7d4f7a0ff79a4126b4947e;hpb=28eb2ae5ccef5f6871c1a82df7e969d333a33d02;ds=sidebyside diff --git a/test/stress/sequential/sequential-misc/spinlock_driver.cpp b/test/stress/sequential/sequential-misc/spinlock_driver.cpp index 99a48153..6dce8121 100644 --- a/test/stress/sequential/sequential-misc/spinlock_driver.cpp +++ b/test/stress/sequential/sequential-misc/spinlock_driver.cpp @@ -23,7 +23,7 @@ static size_t s_nSpinLockPassCount = 2500000000; static size_t s_nTicketLockPassCount = 4000000; #define TASK(lock_type, lock_ptr, pass_cnt) \ - static void Thread##lock_type() { \ + static void Thread##lock_type(lock_type *lock_ptr) { \ for (size_t i = 0; i < pass_cnt; i++) { \ lock_ptr->lock(); \ x++; \ @@ -33,9 +33,9 @@ static size_t s_nTicketLockPassCount = 4000000; #define LOCK_TEST(lock_type, lock_ptr, pass_cnt) \ TEST_F(SpinLockTest, lock_type) { \ - lock_ptr = new lock_type(); \ + std::unique_ptr lock_ptr(new lock_type()); \ x = 0; \ - Thread##lock_type(); \ + Thread##lock_type(lock_ptr.get()); \ } class SpinLockTest : public cds_test::stress_fixture {