This is the mail archive of the libc-alpha@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]

[SH] nptl/tst-abstime: pthread_mutex_timedlock


Hi!

SH needs the analog of what has been changed in commit
2983d85ee5492c4ab1f09ca554e47192fa5c97a2, originally submitted in
<http://sourceware.org/ml/libc-hacker/2010-07/msg00000.html>, but not
fixed for SH at that time.  No other architecture is affected, as (apart
From x86 and x86_64) SH is the only one to use thusly optimized code
governed by __ASSUME_FUTEX_CLOCK_REALTIME, and only uses it in this very
place.  (So, now every usage in glibc and glibc-ports should be correct.)

nptl/
2012-01-24  Thomas Schwinge  <thomas@codesourcery.com>

	* sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_timedlock_wait):
	Check for timestamp before the Epoch.

Index: nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
===================================================================
--- nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	(revision 355696)
+++ nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S	(working copy)
@@ -244,6 +244,12 @@ __lll_timedlock_wait:
 	bt	.Lreltmo
 # endif
 
+	/* if (timeout->tv_sec < 0) return ETIMEDOUT; */
+	mov.l	@r6, r1
+	cmp/pz	r1
+	bf/s	5f
+	 mov	#ETIMEDOUT, r0
+
 	mov	r4, r2
 	mov	r5, r4
 	mov	r7, r5
@@ -279,6 +285,7 @@ __lll_timedlock_wait:
 	neg	r0, r3
 3:
 	mov	r3, r0
+5:
 	rts
 	 mov.l	@r15+, r12
 


GrÃÃe,
 Thomas

Attachment: pgp00000.pgp
Description: PGP signature


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