public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] libio: Assume _IO_lock_inexpensive
@ 2021-06-04 13:26 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2021-06-04 13:26 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=57094e576aed174317fb7de2da34be8536891678
commit 57094e576aed174317fb7de2da34be8536891678
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon May 10 18:05:49 2021 -0300
libio: Assume _IO_lock_inexpensive
It is already set by both Linux and Hurd.
Diff:
---
libio/libio.h | 11 ++---------
sysdeps/mach/libc-lock.h | 3 ---
sysdeps/nptl/stdio-lock.h | 3 ---
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/libio/libio.h b/libio/libio.h
index 98d526dec7..cebdc65763 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -280,17 +280,10 @@ libc_hidden_proto (_IO_sgetn)
# undef _IO_ftrylockfile
# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
-# if _IO_lock_inexpensive
-# define _IO_flockfile(_fp) \
+# define _IO_flockfile(_fp) \
if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
-# define _IO_funlockfile(_fp) \
+# define _IO_funlockfile(_fp) \
if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock)
-# else
-# define _IO_flockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp)
-# define _IO_funlockfile(_fp) \
- if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp)
-# endif
#endif /* _IO_MTSAFE_IO */
#endif /* _LIBIO_H */
diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h
index d713f34b5f..220fcee921 100644
--- a/sysdeps/mach/libc-lock.h
+++ b/sysdeps/mach/libc-lock.h
@@ -24,9 +24,6 @@
#include <tls.h>
#include <lowlevellock.h>
-/* The locking here is very inexpensive, even for inlining. */
-#define _IO_lock_inexpensive 1
-
typedef unsigned int __libc_lock_t;
typedef struct
{
diff --git a/sysdeps/nptl/stdio-lock.h b/sysdeps/nptl/stdio-lock.h
index f2eee49816..a4f419b516 100644
--- a/sysdeps/nptl/stdio-lock.h
+++ b/sysdeps/nptl/stdio-lock.h
@@ -23,9 +23,6 @@
#include <lowlevellock.h>
-/* The locking here is very inexpensive, even for inlining. */
-#define _IO_lock_inexpensive 1
-
typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
#define _IO_lock_t_defined 1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-04 13:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 13:26 [glibc] libio: Assume _IO_lock_inexpensive Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).