Skip to content

Commit

Permalink
Make x86-64 pthread_cond_timedwait more robust.
Browse files Browse the repository at this point in the history
It just happens that __pthread_enable_asynccancel doesn't modify the $rdi
register.  But this isn't guaranteed.  Hence we reload the register after
the calls.
  • Loading branch information
Ulrich Drepper committed Jul 19, 2009
1 parent e2dca2f commit 515a890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2009-07-19 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
(__pthread_cond_timedwait): Make more robust.

2009-07-18 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
Expand Down
2 changes: 2 additions & 0 deletions nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ __pthread_cond_timedwait:
.LcleanupSTART1:
34: callq __pthread_enable_asynccancel
movl %eax, (%rsp)
movq 8(%rsp), %rdi

movq %r13, %r10
cmpq $-1, dep_mutex(%rdi)
Expand Down Expand Up @@ -456,6 +457,7 @@ __pthread_cond_timedwait:
.LcleanupSTART2:
4: callq __pthread_enable_asynccancel
movl %eax, (%rsp)
movq 8(%rsp), %rdi

leaq 32(%rsp), %r10
cmpq $-1, dep_mutex(%rdi)
Expand Down

0 comments on commit 515a890

Please sign in to comment.