From 60698cf37a5b5ad8e486fddef48528cf19209c36 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 18 Mar 2010 19:10:11 +0000 Subject: * shared.cc (init_installation_root): Change to make sure that scope of the lock lasts the entire function. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/shared.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 141bf302b..fb2250735 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2010-03-18 Corinna Vinschen + + * shared.cc (init_installation_root): Change to make sure that scope of + the lock lasts the entire function. + 2010-03-15 Christopher Faylor * shared_info.h (user_info): Add dll_crt0_1 as a friend. diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index 4ef8807aa..10d03b088 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -67,7 +67,8 @@ static LONG installation_root_inited __attribute__((section (".cygwin_dll_common void inline init_installation_root () { - if (!spinlock (installation_root_inited)) + spinlock iri (installation_root_inited); + if (!iri) { if (!GetModuleFileNameW (cygwin_hmodule, installation_root, PATH_MAX)) api_fatal ("Can't initialize Cygwin installation root dir.\n" -- cgit v1.2.3