Changeset 202781 in webkit
- Timestamp:
- Jul 2, 2016 10:47:52 AM (8 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r202736 r202781 1 2016-07-02 Filip Pizlo <fpizlo@apple.com> 2 3 Unreviewed, roll back unintentional commit in r202778. 4 5 * benchmarks/LockFairnessTest.cpp: 6 (main): 7 1 8 2016-07-01 Jer Noble <jer.noble@apple.com> 2 9 -
trunk/Source/WTF/benchmarks/LockFairnessTest.cpp
r202778 r202781 49 49 NO_RETURN void usage() 50 50 { 51 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");51 printf("Usage: LockFairnessTest yieldspinlock|pausespinlock|wordlock|lock|barginglock|bargingwordlock|thunderlock|thunderwordlock|cascadelock|cascadewordlockhandofflock|mutex|all <num threads> <seconds per test>\n"); 52 52 exit(1); 53 53 } … … 55 55 unsigned numThreads; 56 56 double secondsPerTest; 57 unsigned microsecondsInCriticalSection;58 57 59 58 struct Benchmark { … … 74 73 "Benchmark Thread", 75 74 [&, threadIndex] () { 76 if (!microsecondsInCriticalSection) {77 while (keepGoing) {78 lock.lock();79 counts[threadIndex]++;80 lock.unlock();81 }82 return;83 }84 85 75 while (keepGoing) { 86 76 lock.lock(); 87 77 counts[threadIndex]++; 88 usleep(microsecondsInCriticalSection);89 78 lock.unlock(); 90 79 } … … 118 107 WTF::initializeThreading(); 119 108 120 if (argc != 5109 if (argc != 4 121 110 || sscanf(argv[2], "%u", &numThreads) != 1 122 || sscanf(argv[3], "%lf", &secondsPerTest) != 1 123 || sscanf(argv[4], "%u", µsecondsInCriticalSection) != 1) 111 || sscanf(argv[3], "%lf", &secondsPerTest) != 1) 124 112 usage(); 125 113
Note: See TracChangeset
for help on using the changeset viewer.