Skip to content

Commit

Permalink
Enable common version of pthread_cond_timedwait to use clock_gettime …
Browse files Browse the repository at this point in the history
…in VDSO
  • Loading branch information
Luis Machado authored and Ulrich Drepper committed Mar 24, 2010
1 parent 7d9335e commit 7749bf5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2010-03-23 Luis Machado <luisgpm@br.ibm.com>

* pthread_cond_timedwait.c: Add check for
HAVE_CLOCK_GETTIME_VSYSCALL to use VDSO whenever possible.
(pthread_cond_timedwait): Use INTERNAL_VSYSCALL instead of
INTERNAL_SYSCALL.

2010-03-09 Ulrich Drepper <drepper@redhat.com>

* pthread_create.c (__pthread_create_2_1): If priorities are incorrect
Expand Down
12 changes: 10 additions & 2 deletions nptl/pthread_cond_timedwait.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
Expand Down Expand Up @@ -27,6 +27,14 @@

#include <shlib-compat.h>

#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
# undef INTERNAL_VSYSCALL
# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
# undef INLINE_VSYSCALL
# define INLINE_VSYSCALL INLINE_SYSCALL
#else
# include <bits/libc-vdso.h>
#endif

/* Cleanup handler, defined in pthread_cond_wait.c. */
extern void __condvar_cleanup (void *arg)
Expand Down Expand Up @@ -102,7 +110,7 @@ __pthread_cond_timedwait (cond, mutex, abstime)
#ifdef __NR_clock_gettime
INTERNAL_SYSCALL_DECL (err);
int ret;
ret = INTERNAL_SYSCALL (clock_gettime, err, 2,
ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
(cond->__data.__nwaiters
& ((1 << COND_NWAITERS_SHIFT) - 1)),
&rt);
Expand Down

0 comments on commit 7749bf5

Please sign in to comment.