diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-08-22 05:51:01 +0300 |
---|---|---|
committer | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-08-27 12:20:02 +1000 |
commit | 47bd795b35c0e6b259dc16521966232cbdd7c190 (patch) | |
tree | fb223111cf12b162720c35909af052d75fbb6a7d /io_cache_test/io_cache_test.cpp | |
parent | 98ab2af187c79f8a05421b2e252583dfc8850265 (diff) | |
download | mariadb-git-MDEV-24676_cpp.tar.gz |
fix wraparound race conditionMDEV-24676_cpp
also improve locking granularity regarding flush
remove atomic on bool, since it is already protected under lock
add more volatile specs
add comments, improve structure packing
Diffstat (limited to 'io_cache_test/io_cache_test.cpp')
-rw-r--r-- | io_cache_test/io_cache_test.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/io_cache_test/io_cache_test.cpp b/io_cache_test/io_cache_test.cpp index 947baa6cc47..5bb8dd0f1db 100644 --- a/io_cache_test/io_cache_test.cpp +++ b/io_cache_test/io_cache_test.cpp @@ -18,6 +18,8 @@ void *read_to_cache(void *) { } void *write_to_cache(void *args) { + struct st_my_thread_var thdvar; + set_mysys_var(&thdvar); pthread_barrier_wait(&barrier); int *v_args= (int *) args; for (int i= v_args[0]; i < v_args[1]; ++i) @@ -90,4 +92,4 @@ int main() { of.open("test_out.txt", std::ios_base::out); of << buff_to; return 0; -}
\ No newline at end of file +} |