This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-623-g2cf3e1a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2cf3e1aa7477b813ca3ebb901003a7d44f970218 (commit)
      from  661a29a518245e5e82bc51bf290a2f43a0991714 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2cf3e1aa7477b813ca3ebb901003a7d44f970218

commit 2cf3e1aa7477b813ca3ebb901003a7d44f970218
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Dec 22 14:39:19 2015 +0100

    Harmonize generic stdio-lock support with nptl
    
    	This fixes build when _IO_funlockfile is a macro, fixes build where
    	_IO_acquire_lock_clear_flags2 is used, and fixes unlocking on unexpected
    	stack unwind.
    
    	* sysdeps/generic/stdio-lock.h [__EXCEPTIONS] (_IO_acquire_lock,
    	_IO_release_lock ): Use cleanup attribute on new
    	_IO_acquire_lock_file variable instead of assuming that
    	_IO_release_lock will be called.
    	[!__EXCEPTIONS] (_IO_acquire_lock): Define to non-existing
    	_IO_acquire_lock_needs_exceptions_enabled.
    	(_IO_acquire_lock_clear_flags2): New macro.

diff --git a/ChangeLog b/ChangeLog
index 3c15a05..a57db54 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-12-22  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	Harmonize generic stdio-lock support with nptl
+
+	This fixes build when _IO_funlockfile is a macro, fixes build where
+	_IO_acquire_lock_clear_flags2 is used, and fixes unlocking on unexpected
+	stack unwind.
+
+	* sysdeps/generic/stdio-lock.h [__EXCEPTIONS] (_IO_acquire_lock,
+	_IO_release_lock ): Use cleanup attribute on new
+	_IO_acquire_lock_file variable instead of assuming that
+	_IO_release_lock will be called.
+	[!__EXCEPTIONS] (_IO_acquire_lock): Define to non-existing
+	_IO_acquire_lock_needs_exceptions_enabled.
+	(_IO_acquire_lock_clear_flags2): New macro.
+
 2015-12-22  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/powerpc/fpu/libm-test-ulps: Regenerated.
diff --git a/sysdeps/generic/stdio-lock.h b/sysdeps/generic/stdio-lock.h
index 38f93ef..5f232f9 100644
--- a/sysdeps/generic/stdio-lock.h
+++ b/sysdeps/generic/stdio-lock.h
@@ -45,13 +45,26 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
   __libc_cleanup_region_end (_doit)
 
 #if defined _LIBC && IS_IN (libc)
+
+# ifdef __EXCEPTIONS
 # define _IO_acquire_lock(_fp) \
-  _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp));      \
-  _IO_flockfile (_fp)
+  do {									      \
+    _IO_FILE *_IO_acquire_lock_file					      \
+	__attribute__((cleanup (_IO_acquire_lock_fct)))			      \
+	= (_fp);							      \
+    _IO_flockfile (_IO_acquire_lock_file);
+#  define _IO_acquire_lock_clear_flags2(_fp) \
+  do {									      \
+    _IO_FILE *_IO_acquire_lock_file					      \
+	__attribute__((cleanup (_IO_acquire_lock_clear_flags2_fct)))	      \
+	= (_fp);							      \
+    _IO_flockfile (_IO_acquire_lock_file);
+# else
+#  define _IO_acquire_lock(_fp) _IO_acquire_lock_needs_exceptions_enabled
+#  define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
+# endif
+# define _IO_release_lock(_fp) ; } while (0)
 
-# define _IO_release_lock(_fp) \
-  _IO_funlockfile (_fp);						      \
-  _IO_cleanup_region_end (0)
 #endif
 
 #endif /* stdio-lock.h */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |   16 ++++++++++++++++
 sysdeps/generic/stdio-lock.h |   23 ++++++++++++++++++-----
 2 files changed, 34 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]