Ugh. Once again, unreviewed, roll out unintentional commit in r202790.
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jul 2016 17:47:51 +0000 (17:47 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jul 2016 17:47:51 +0000 (17:47 +0000)
* benchmarks/LockFairnessTest.cpp:
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202791 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/benchmarks/LockFairnessTest.cpp

index 9721dfa..dbe6648 100644 (file)
@@ -1,3 +1,10 @@
+2016-07-03  Filip Pizlo  <fpizlo@apple.com>
+
+        Ugh. Once again, unreviewed, roll out unintentional commit in r202790.
+
+        * benchmarks/LockFairnessTest.cpp:
+        (main):
+
 2016-07-02  Dan Bernstein  <mitz@apple.com>
 
         Build fix.
index f08321c..e808908 100644 (file)
@@ -48,13 +48,12 @@ namespace {
 
 NO_RETURN void usage()
 {
-    printf("Usage: LockFairnessTest yieldspinlock|pausespinlock|wordlock|lock|barginglock|bargingwordlock|thunderlock|thunderwordlock|cascadelock|cascadewordlockhandofflock|mutex|all <num threads> <seconds per test> <microseconds in critical section>\n");
+    printf("Usage: LockFairnessTest yieldspinlock|pausespinlock|wordlock|lock|barginglock|bargingwordlock|thunderlock|thunderwordlock|cascadelock|cascadewordlockhandofflock|mutex|all <num threads> <seconds per test>\n");
     exit(1);
 }
 
 unsigned numThreads;
 double secondsPerTest;
-unsigned microsecondsInCriticalSection;
 
 struct Benchmark {
     template<typename LockType>
@@ -73,19 +72,9 @@ struct Benchmark {
             threads[threadIndex] = createThread(
                 "Benchmark Thread",
                 [&, threadIndex] () {
-                    if (!microsecondsInCriticalSection) {
-                        while (keepGoing) {
-                            lock.lock();
-                            counts[threadIndex]++;
-                            lock.unlock();
-                        }
-                        return;
-                    }
-                    
                     while (keepGoing) {
                         lock.lock();
                         counts[threadIndex]++;
-                        usleep(microsecondsInCriticalSection);
                         lock.unlock();
                     }
                 });
@@ -96,8 +85,8 @@ struct Benchmark {
     
         sleep(secondsPerTest);
     
-        keepGoing = false;
         lock.lock();
+        keepGoing = false;
     
         dataLog(name, ": ");
         CommaPrinter comma;
@@ -117,10 +106,9 @@ int main(int argc, char** argv)
 {
     WTF::initializeThreading();
     
-    if (argc != 5
+    if (argc != 4
         || sscanf(argv[2], "%u", &numThreads) != 1
-        || sscanf(argv[3], "%lf", &secondsPerTest) != 1
-        || sscanf(argv[4], "%u", &microsecondsInCriticalSection) != 1)
+        || sscanf(argv[3], "%lf", &secondsPerTest) != 1)
         usage();
     
     runEverything<Benchmark>(argv[1]);