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**.
Showing
想要评论请 注册 或 登录