v.20.8Improvement

Fix data race in lgamma function detected by tsan

Fix data race in lgamma function. This race was caught only in tsan, no side effects a really happened. #13842 (Nikolai Kochetov).
Fix a data race condition in the lgamma mathematical function detected by tsan.

Why it matters

This fix addresses a concurrency issue in the lgamma function that was detected by ThreadSanitizer (tsan). Although the race had no observable side effects, resolving it improves the reliability and thread-safety of the function.

How to use it

This fix is applied internally within ClickHouse; no user action is required. Users benefit from improved stability when invoking the lgamma function in their queries.