提交 6cebd3ee 编写于 作者: A Azat Khuzhin

Fix UB by unlocking the rwlock of the TinyLog from the same thread

Before this patch the build with libstdc++ hangs for
00967_insert_into_distributed_different_types test (and I guess some
others), this is because the rwlock is acquired from different thread as
it was unlocked which causes UB [1], fix this by moving unlock into
writeSuffix().

  [1]: The pthread_rwlock_unlock() function shall release a lock held on
       the read-write lock object referenced by rwlock. Results are undefined
       if the read-write lock rwlock is not held by the **calling thread**.
上级 10d35867
......@@ -357,6 +357,8 @@ void TinyLogBlockOutputStream::writeSuffix()
for (const auto & file : column_files)
storage.file_checker.update(file);
storage.file_checker.save();
lock.unlock();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册