diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2019-02-04 21:16:15 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2019-02-04 21:16:15 +0000 |
commit | e4314da2e45770e4b9b3be74f4b552045a041d3a (patch) | |
tree | 736de00ae961ea70e86f0ee5804605454a4bbdef /usr.sbin/efivar/efiutil.c | |
parent | bfce461ee9cf85d2e0cc2caa7756af4ee61ec8ab (diff) | |
download | src-e4314da2e45770e4b9b3be74f4b552045a041d3a.tar.gz src-e4314da2e45770e4b9b3be74f4b552045a041d3a.zip |
Fixes for very early use of the pthread_mutex_* and libthr malloc.
When libthr is statically linked into the binary, order of the
constructors execution is not deterministic. It is possible for the
application constructor to use pthread_mutex_* functions before the
libthr initialization was done.
Handle it by:
- making thr_malloc.c locking functions operational when curthread is not
yet set;
- making __thr_malloc_init() idempotent, allowing more than one call to it;
- unconditionally calling __thr_malloc_init() before initializing
a process-private mutex.
Reported and tested by: mmel
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=343754
Diffstat (limited to 'usr.sbin/efivar/efiutil.c')
0 files changed, 0 insertions, 0 deletions