PageRenderTime 111ms CodeModel.GetById 76ms app.highlight 1ms RepoModel.GetById 14ms app.codeStats 0ms

/examples/thread_safety.fy

http://github.com/bakkdoor/redis.fy
Unknown | 14 lines | 11 code | 3 blank | 0 comment | 0 complexity | 7a10396672a0616aad6e10a1071402b3 MD5 | raw file
 1require: "redis"
 2
 3r = Redis Client new
 4
 5threads = []
 610 times: |i| {
 7  t = Thread new: {
 8    r set: ("foo", "test: #{i}")
 9    r get: "foo" . println
10  }
11  threads << t
12}
13
14threads each: 'join