summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtipc/lackey/scripts/systemsemaphore_acquire.js
blob: 5cff429b863675df9a37eb3161389055e2e8c1c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#/bin/qscript
function QVERIFY(x, debugInfo) {
    if (!(x)) {
        print(debugInfo);
        throw(debugInfo);
    }
}


var sem = new ScriptSystemSemaphore;
sem.setKey("store");

var count = Number(args[1]);
if (isNaN(count))
    count = 1;
for (var i = 0; i < count; ++i)
    QVERIFY(sem.acquire());
print("done aquiring");