summaryrefslogtreecommitdiff
path: root/libthreads
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-30 19:25:30 +0000
committerRoland McGrath <roland@gnu.org>2000-03-30 19:25:30 +0000
commit545b4834b4100e05fbc6cef6f78ef6954cd91781 (patch)
tree02d6de267c9ea277f10ceea9a29e17c4d9ac8ac4 /libthreads
parentd7da225a3013c450ed2ed8cfef99e11bd1d4162a (diff)
2000-03-30 Roland McGrath <roland@baalperazim.frob.com>
* libthreads.map: Define HURD_CTHREADS_0.3 version set, putting all symbols there except the lockfile symbols. * lockfile.c: Nit fixes.
Diffstat (limited to 'libthreads')
-rw-r--r--libthreads/libthreads.map6
-rw-r--r--libthreads/lockfile.c30
2 files changed, 21 insertions, 15 deletions
diff --git a/libthreads/libthreads.map b/libthreads/libthreads.map
index 28c85017..0f53f58b 100644
--- a/libthreads/libthreads.map
+++ b/libthreads/libthreads.map
@@ -16,4 +16,10 @@ VERSION
local:
_cthreads_flockfile; _cthreads_funlockfile; _cthreads_ftrylockfile;
};
+
+ HURD_CTHREADS_0.3
+ {
+ global:
+ *;
+ };
};
diff --git a/libthreads/lockfile.c b/libthreads/lockfile.c
index b0b019de..c815185c 100644
--- a/libthreads/lockfile.c
+++ b/libthreads/lockfile.c
@@ -27,10 +27,6 @@
#ifdef _STDIO_USES_IOSTREAM
-#undef _IO_flockfile
-#undef _IO_funlockfile
-#undef _IO_ftrylockfile
-
void
_cthreads_flockfile (_IO_FILE *fp)
{
@@ -43,7 +39,7 @@ _cthreads_flockfile (_IO_FILE *fp)
}
else
{
- __mutex_lock (&fp->_lock->mutex);
+ mutex_lock (&fp->_lock->mutex);
assert (fp->_lock->owner == 0);
fp->_lock->owner = self;
assert (fp->_lock->count == 0);
@@ -58,7 +54,7 @@ _cthreads_funlockfile (_IO_FILE *fp)
{
assert (fp->_lock->owner == cthread_self ());
fp->_lock->owner = 0;
- __mutex_unlock (&fp->_lock->mutex);
+ mutex_unlock (&fp->_lock->mutex);
}
}
@@ -72,7 +68,7 @@ _cthreads_ftrylockfile (_IO_FILE *fp)
assert (fp->_lock->count != 0);
++fp->_lock->count;
}
- else if (__mutex_try_lock (&fp->_lock->mutex))
+ else if (mutex_try_lock (&fp->_lock->mutex))
{
assert (fp->_lock->owner == 0);
fp->_lock->owner = self;
@@ -86,16 +82,20 @@ _cthreads_ftrylockfile (_IO_FILE *fp)
return 1;
}
-#define strong_alias(src, dst) asm (".globl " #dst "; " #dst " = " #src)
-#define weak_alias(src, dst) asm (".weak " #dst "; " #dst " = " #src)
-weak_alias (_cthreads_flockfile, _IO_flockfile);
-weak_alias (_cthreads_funlockfile, _IO_funlockfile);
-weak_alias (_cthreads_ftrylockfile, _IO_ftrylockfile);
+# undef _IO_flockfile
+# undef _IO_funlockfile
+# undef _IO_ftrylockfile
+# pragma weak _IO_flockfile = _cthreads_flockfile
+# pragma weak _IO_funlockfile = _cthreads_funlockfile
+# pragma weak _IO_ftrylockfile= _cthreads_ftrylockfile
-weak_alias (_cthreads_flockfile, flockfile);
-weak_alias (_cthreads_funlockfile, funlockfile);
-weak_alias (_cthreads_ftrylockfile, ftrylockfile);
+# undef flockfile
+# undef funlockfile
+# undef ftrylockfile
+# pragma weak flockfile = _cthreads_flockfile
+# pragma weak funlockfile = _cthreads_funlockfile
+# pragma weak ftrylockfile = _cthreads_ftrylockfile
#endif /* _STDIO_USES_IOSTREAM */