git: d6a896c3c83b - stable/14 - pthread_mutex_trylock(): init libthr if needed

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 21 Jan 2025 00:26:40 UTC
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=d6a896c3c83b1a0f473563dad5fc3f0427ee6f64

commit d6a896c3c83b1a0f473563dad5fc3f0427ee6f64
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-01-12 11:28:52 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-01-21 00:24:55 +0000

    pthread_mutex_trylock(): init libthr if needed
    
    (cherry picked from commit 9718f18471f700b271eb898c764e02b7fcd3766f)
---
 lib/libthr/thread/thr_mutex.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index ca8971cc720a..32bdc4afe65f 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -619,6 +619,7 @@ __Tthr_mutex_trylock(pthread_mutex_t *mutex)
 	uint32_t id;
 	int ret, robust;
 
+	_thr_check_init();
 	ret = check_and_init_mutex(mutex, &m);
 	if (ret != 0)
 		return (ret);