diff options
Diffstat (limited to 'tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js')
-rw-r--r-- | tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js b/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js new file mode 100644 index 0000000..5cff429 --- /dev/null +++ b/tests/auto/qsharedmemory/lackey/scripts/systemsemaphore_acquire.js @@ -0,0 +1,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"); |