Mark `mono_g_hash_table_max_chain_length` as known and accepted data race (#5520)
authorArmin Hasitzka <cherusker@users.noreply.github.com>
Wed, 20 Sep 2017 20:01:03 +0000 (22:01 +0200)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 20 Sep 2017 20:01:03 +0000 (22:01 +0200)
commit5b483a682096189eddd25d856358726f007fdbcf
treed890bbeaf29af15a3baf338ca682cd05cc61a702
parentc7e322d704332360ffdb32aa18d722b3f93cb8cc
Mark `mono_g_hash_table_max_chain_length` as known and accepted data race (#5520)

[TSan] Unlock mono_g_hash_table_max_chain_length

I would suggest using `Unlocked* ()` here. `mono_g_hash_table_find_slot ()` is called relatively often and, unlike increment or add operations, read and write operations (without a global surrounding lock) do not gain much (if anything) by being interlocked as long as they can be read and written by one instruction. That should be true for 32-bit integers and Mono's supported platforms.
mono/metadata/mono-hash.c
mono/metadata/mono-hash.h