Date: Mon, 30 Nov 2020 17:00:36 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368190 - head/lib/libthr/thread Message-ID: <202011301700.0AUH0aHF078838@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Nov 30 17:00:36 2020 New Revision: 368190 URL: https://svnweb.freebsd.org/changeset/base/368190 Log: Ensure that threading library is initialized in pthread_mutex_init(). We need at least thr_malloc ready. The situation is possible e.g. in case of libthr being listed in DT_NEEDED before some of its consumers. Reported and tested by: lev Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Mon Nov 30 16:18:33 2020 (r368189) +++ head/lib/libthr/thread/thr_mutex.c Mon Nov 30 17:00:36 2020 (r368190) @@ -384,6 +384,8 @@ __Tthr_mutex_init(pthread_mutex_t * __restrict mutex, struct pthread_mutex *pmtx; int ret; + _thr_check_init(); + if (mutex_attr != NULL) { ret = mutex_check_attr(*mutex_attr); if (ret != 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011301700.0AUH0aHF078838>