summaryrefslogtreecommitdiff
path: root/lib/thread
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-12 20:37:51 -0400
committerOri Bernstein <ori@eigenstate.org>2016-05-12 20:37:51 -0400
commitf8152dae21873cf42f2d65bdf657a717c2240a25 (patch)
tree382f0592f5648cadc1ff9f58dae82ba97a2346a9 /lib/thread
parentbccdc9c4492e0270322b0b0ab81fa509c5390ab2 (diff)
downloadmc-f8152dae21873cf42f2d65bdf657a717c2240a25.tar.gz
Exercise some of the allocation/put locking.
Diffstat (limited to 'lib/thread')
-rw-r--r--lib/thread/test/mutex.myr5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/thread/test/mutex.myr b/lib/thread/test/mutex.myr
index 226bef5..e29ae85 100644
--- a/lib/thread/test/mutex.myr
+++ b/lib/thread/test/mutex.myr
@@ -18,15 +18,16 @@ const main = {
while thread.xget(&done) != Nherd
/* nothing */
;;
- if val != 10_000 * 20
+ if val != 1000 * 20
std.fatal("mutexes are broken, got {}\n", val)
;;
}
const incvar = {
- for var i = 0; i < 10_000; i++
+ for var i = 0; i < 1000; i++
thread.mtxlock(&mtx)
val++
+ std.put("val: {}\n", val)
thread.mtxunlock(&mtx)
;;
thread.xadd(&done, 1)