about summary refs log tree commit diff
path: root/mach
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-04-01 09:01:49 +0000
committerRoland McGrath <roland@gnu.org>1995-04-01 09:01:49 +0000
commit2f8033d6067fff3e7d77bb2174a9564bd7199cea (patch)
tree338cc27cac49feff7928918f6f78b7bc9e129993 /mach
parent5de9ba232c42a03b7c9839f9ed907a24d63d7c78 (diff)
downloadglibc-2f8033d6067fff3e7d77bb2174a9564bd7199cea.tar.gz
glibc-2f8033d6067fff3e7d77bb2174a9564bd7199cea.tar.xz
glibc-2f8033d6067fff3e7d77bb2174a9564bd7199cea.zip
Sat Apr 1 00:08:06 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* locale/loadlocale.c (_nl_load_locale) [MAP_FILE]: Define it zero
 	if undefined.

	* string/strxfrm.c: Just copy the string (for now).
	* string/strcoll.c: Just call strcmp (for now).

	* mach/Makefile (lock): Add mutex-init.
	* mach/mutex-solid.c (_cthread_mutex_lock_routine,
 	_cthread_mutex_unlock_routine): Variables removed.
	(__mutex_lock_solid, __mutex_unlock_solid): Don't use them; just stub.
	(__mutex_init): Function moved to new file mutex-init.c.
	* mach/mutex-init.c: New file, broken out of mutex-solid.c.
Diffstat (limited to 'mach')
-rw-r--r--mach/Makefile2
-rw-r--r--mach/mutex-solid.c27
2 files changed, 8 insertions, 21 deletions
diff --git a/mach/Makefile b/mach/Makefile
index 3a7a8fe82a..509785cb60 100644
--- a/mach/Makefile
+++ b/mach/Makefile
@@ -28,7 +28,7 @@ headers = mach_init.h mach.h mach_error.h mach-shortcuts.h mach/mach_traps.h \
 	  $(interface-headers) mach/mach.h mach/mig_support.h mach/error.h \
 	  $(lock-headers) machine-sp.h
 distribute = thread_state.h
-lock = spin-solid spin-lock mutex-solid
+lock = spin-solid spin-lock mutex-init mutex-solid
 lock-headers = lock-intern.h machine-lock.h spin-lock.h
 routines = $(mach-syscalls) $(mach-shortcuts) \
 	   mach_init mig_strncpy msg \
diff --git a/mach/mutex-solid.c b/mach/mutex-solid.c
index aeaa269c6b..db203d9d6e 100644
--- a/mach/mutex-solid.c
+++ b/mach/mutex-solid.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1994 Free Software Foundation, Inc.
+/* Stub versions of mutex_lock_solid/mutex_unlock_solid for no -lthreads.
+Copyright (C) 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -19,32 +20,18 @@ Cambridge, MA 02139, USA.  */
 #include <lock-intern.h>
 #include <cthreads.h>
 
-/* If cthreads is linked in, it will define these variables with values
-   that point to its mutex functions.  */
-void (*_cthread_mutex_lock_routine) (struct mutex *);
-void (*_cthread_mutex_unlock_routine) (struct mutex *);
+/* If cthreads is linked in, it will define these functions itself to do
+   real cthreads mutex locks.  This file will only be linked in when
+   cthreads is not used, and `mutexes' are in fact just spin locks (and
+   some unused storage).  */
 
 void
 __mutex_lock_solid (void *lock)
 {
-  if (_cthread_mutex_lock_routine)
-    (*_cthread_mutex_lock_routine) (lock);
-  else
-    __spin_lock_solid (lock);
+  __spin_lock_solid (lock);
 }
 
 void
 __mutex_unlock_solid (void *lock)
 {
-  if (_cthread_mutex_unlock_routine)
-    (*_cthread_mutex_unlock_routine) (lock);
-}
-
-void
-__mutex_init (void *lock)
-{
-  /* This happens to be name space-safe because it is a macro.
-     It invokes only spin_lock_init, which is a macro for __spin_lock_init;
-     and cthread_queue_init, which is a macro for some simple code.  */
-  mutex_init ((struct mutex *) lock);
 }