diff options
author | Eric Wong <e@80x24.org> | 2018-07-15 10:23:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-07-16 19:34:32 +0000 |
commit | 23a6354cb74b5f0e61ea39776d7cefc9570b07d6 (patch) | |
tree | 1a26a9291925fbac725aeaac89d33eb8e7f875a5 /test | |
parent | dea1a38e2390c40a71591a4c08c5c021b9693328 (diff) | |
download | mwrap-23a6354cb74b5f0e61ea39776d7cefc9570b07d6.tar.gz |
PTHREAD_MUTEX_INITIALIZER is incomplete, in that it does lazy initialization when pthread_mutex_init is called. So we call pthread_mutex_init explicitly, as well as calling rcu_read_lock during the constructor to initialize mutexes used by urcu-bp.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_mwrap.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb index 2234f7d..bc8694e 100644 --- a/test/test_mwrap.rb +++ b/test/test_mwrap.rb @@ -183,6 +183,7 @@ class TestMwrap < Test::Unit::TestCase -e locs="" -e Mwrap.each(1){|loc,tot,calls|locs<<loc} -e m=locs.match(/(\[0x[a-f0-9]+\])/i) + -e m||=locs.match(/\b(0x[a-f0-9]+)\b/i) -e p(loc=Mwrap["bobloblaw\t#{m[1]}"]) -e loc.each{|size,gen|p([size,gen,count])} ) @@ -240,12 +241,12 @@ class TestMwrap < Test::Unit::TestCase addr = false Mwrap.each do |a,| - if a =~ /\[0x[a-f0-9]+\]/ + if a =~ /0x[a-f0-9]+/ addr = a break end end - addr.frozen? or abort 'Mwrap.each returned unfrozen address' + addr && addr.frozen? or abort 'Mwrap.each returned unfrozen address' loc = Mwrap[addr] or abort "Mwrap[#{addr}] broken" addr == loc.name or abort 'SourceLocation#name works on address' loc.name.frozen? or abort 'SourceLocation#name not frozen' |