Bypass npth_unprotect/protect when npth has not yet been initialized.
authorWerner Koch <wk@gnupg.org>
Mon, 21 Nov 2016 08:35:26 +0000 (09:35 +0100)
committerWerner Koch <wk@gnupg.org>
Mon, 21 Nov 2016 08:35:26 +0000 (09:35 +0100)
commit50d6d727c8da21cf78dcd5a2ee969f46864fa124
tree5ad1c3ddd68328a9aa81443d303fdd822a103a72
parent8cddd2ce70f85eea6c68ca6d03080181a2eea976
Bypass npth_unprotect/protect when npth has not yet been initialized.

* src/npth.c (initialized_or_any_threads): New variable.
(npth_init): Set var.
(npth_create): Set var.
(npth_unprotect, npth_protect): Shortcut if not initialized.

* w32/npth.c (initialized_or_any_threads): New variable.
(npth_init): Set var.
(npth_unprotect, npth_protect): Shortcut if not initialized.

Signed-off-by: Werner Koch <wk@gnupg.org>
src/npth.c
w32/npth.c