summaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/Kernel/OVR_Lockless.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/Kernel/OVR_Lockless.cpp')
-rw-r--r--LibOVR/Src/Kernel/OVR_Lockless.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/LibOVR/Src/Kernel/OVR_Lockless.cpp b/LibOVR/Src/Kernel/OVR_Lockless.cpp
index 0f25805..6a5ec6b 100644
--- a/LibOVR/Src/Kernel/OVR_Lockless.cpp
+++ b/LibOVR/Src/Kernel/OVR_Lockless.cpp
@@ -1,21 +1,20 @@
/************************************************************************************
-PublicHeader: OVR.h
Filename : OVR_Lockless.cpp
Content : Test logic for lock-less classes
Created : December 27, 2013
Authors : Michael Antonov
-Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
-http://www.oculusvr.com/licenses/LICENSE-3.1
+http://www.oculusvr.com/licenses/LICENSE-3.2
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,13 +32,12 @@ limitations under the License.
#include "OVR_Timer.h"
#include "OVR_Log.h"
-
namespace OVR { namespace LocklessTest {
const int TestIterations = 10000000;
-// Use volatile dummys to force compiler to do spinning.
+// Use volatile dummies to force compiler to do spinning.
volatile int Dummy1;
int Unused1[32];
volatile int Dummy2;
@@ -91,7 +89,7 @@ struct TestData
volatile bool FirstItemWritten = false;
-LocklessUpdater<TestData> TestDataUpdater;
+LocklessUpdater<TestData, TestData> TestDataUpdater;
// Use this lock to verify that testing algorithm is otherwise correct...
Lock TestLock;
@@ -108,7 +106,6 @@ class Consumer : public Thread
{
LogText("LocklessTest::Consumer::Run started.\n");
-
while (!FirstItemWritten)
{
// spin until producer wrote first value...
@@ -216,13 +213,10 @@ void StartLocklessTest()
producerThread->Start();
consumerThread->Start();
- /*
while (!producerThread->IsFinished() && consumerThread->IsFinished())
{
Thread::MSleep(500);
- } */
-
- // TBD: Cleanup
+ }
}