diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-03 09:46:16 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-03 09:46:16 +0200 |
commit | 420e50697cd036a0d8ea1601961bd6974703ade1 (patch) | |
tree | fd922454b4f94fb38333d3bd49679e01afb56fb5 /tests | |
parent | f7a38b5681ebf7429828fca9a9f7c109df853d54 (diff) | |
download | lanes-420e50697cd036a0d8ea1601961bd6974703ade1.tar.gz lanes-420e50697cd036a0d8ea1601961bd6974703ade1.tar.bz2 lanes-420e50697cd036a0d8ea1601961bd6974703ade1.zip |
Clarified keeper.cpp stack tracking comments
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fifo.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/fifo.lua b/tests/fifo.lua index 498f540..d741931 100644 --- a/tests/fifo.lua +++ b/tests/fifo.lua | |||
@@ -11,6 +11,9 @@ local atomic_inc= lanes.genatomic( atomic_linda, "FIFO_n") | |||
11 | 11 | ||
12 | local fifo_linda = lanes.linda( "fifo") | 12 | local fifo_linda = lanes.linda( "fifo") |
13 | 13 | ||
14 | -- Lua 5.1 support | ||
15 | local table_unpack = table.unpack or unpack | ||
16 | |||
14 | assert( atomic_inc()==1) | 17 | assert( atomic_inc()==1) |
15 | assert( atomic_inc()==2) | 18 | assert( atomic_inc()==2) |
16 | 19 | ||
@@ -40,15 +43,18 @@ print "Sending to B.." | |||
40 | B:send( 'a','b','c') | 43 | B:send( 'a','b','c') |
41 | 44 | ||
42 | print "Dumping linda stats.. [1]" -- count everything | 45 | print "Dumping linda stats.. [1]" -- count everything |
43 | for key,count in pairs(fifo_linda:count()) do | 46 | local stats = fifo_linda:count() |
47 | for key,count in pairs(stats) do | ||
44 | print("channel " .. key .. " contains " .. count .. " entries.") | 48 | print("channel " .. key .. " contains " .. count .. " entries.") |
45 | -- print(i, key_count[1], key_count[2]) | 49 | -- print(i, key_count[1], key_count[2]) |
46 | end | 50 | end |
51 | |||
47 | print "Dumping linda stats.. [2]" -- query count for known channels one at a time | 52 | print "Dumping linda stats.. [2]" -- query count for known channels one at a time |
48 | print("channel " .. A.channel .. " contains " .. fifo_linda:count(A.channel) .. " entries.") | 53 | print("channel " .. A.channel .. " contains " .. fifo_linda:count(A.channel) .. " entries.") |
49 | print("channel " .. B.channel .. " contains " .. fifo_linda:count(B.channel) .. " entries.") | 54 | print("channel " .. B.channel .. " contains " .. fifo_linda:count(B.channel) .. " entries.") |
50 | print "Dumping linda stats.. [3]" -- query counts for a predefined list of keys | 55 | |
51 | for key,count in pairs(fifo_linda:count(A.channel, B.channel)) do | 56 | print "Dumping linda stats.. [3]" -- query counts for a predefined list of keys, tossing unknown keys in the mix for good measure |
57 | for key,count in pairs(fifo_linda:count("unknown key", A.channel, "unknown key", B.channel, "unknown key", "unknown key")) do | ||
52 | print("channel " .. key .. " contains " .. count .. " entries.") | 58 | print("channel " .. key .. " contains " .. count .. " entries.") |
53 | -- print(i, key_count[1], key_count[2]) | 59 | -- print(i, key_count[1], key_count[2]) |
54 | end | 60 | end |