Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-08-23 00:48:23 +0400
committerPaul Brook <paul@codesourcery.com>2006-08-23 00:48:23 +0400
commitfe28d47d3bc662651cb01c06e5078caf59442e19 (patch)
treee302fe1b89a694213624fad885b2e45ddd61a6e5
parent5f6fc2565bb156cf0834d773dc7f2daa7cdde090 (diff)
2006-08-22 Paul Brook <paul@codesourcery.com>
newlib/ * libc/sys/arm/syscalls.c (initialise_monitor_handles): Fix multithreaded locking.
-rw-r--r--ChangeLog.csl6
-rw-r--r--newlib/libc/sys/arm/syscalls.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 24f721aaf..83d7bbb6d 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,9 @@
+2006-08-22 Paul Brook <paul@codesourcery.com>
+
+ newlib/
+ * libc/sys/arm/syscalls.c (initialise_monitor_handles): Fix
+ multithreaded locking.
+
2006-07-24 Nathan Sidwell <nathan@codesourcery.com>
Bug 844
diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c
index ebbd087e4..33610c2e1 100644
--- a/newlib/libc/sys/arm/syscalls.c
+++ b/newlib/libc/sys/arm/syscalls.c
@@ -112,10 +112,11 @@ initialise_monitor_handles (void)
#ifndef __SINGLE_THREAD__
__lock_acquire_recursive (__arm_monitor_handles_lock);
-#endif
- initialized = 1;
-#ifndef __SINGLE_THREAD__
- __lock_release_recursive (__arm_monitor_handles_lock);
+ if (initialized)
+ {
+ __lock_release_recursive (__arm_monitor_handles_lock);
+ return;
+ }
#endif
#ifdef ARM_RDI_MONITOR
@@ -156,6 +157,11 @@ initialise_monitor_handles (void)
openfiles[0].pos = 0;
openfiles[1].handle = monitor_stdout;
openfiles[1].pos = 0;
+
+ initialized = 1;
+#ifndef __SINGLE_THREAD__
+ __lock_release_recursive (__arm_monitor_handles_lock);
+#endif
}
static int