+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.
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>
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();
}
});
sleep(secondsPerTest);
- keepGoing = false;
lock.lock();
+ keepGoing = false;
dataLog(name, ": ");
CommaPrinter comma;
{
WTF::initializeThreading();
- if (argc != 5
+ if (argc != 4
|| sscanf(argv[2], "%u", &numThreads) != 1
- || sscanf(argv[3], "%lf", &secondsPerTest) != 1
- || sscanf(argv[4], "%u", µsecondsInCriticalSection) != 1)
+ || sscanf(argv[3], "%lf", &secondsPerTest) != 1)
usage();
runEverything<Benchmark>(argv[1]);