-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdlib.h>
-#include "atomic.h"
+#include <atomic.h>
#include "pthreadP.h"
int
-pthread_timedjoin_np (threadid, thread_return, abstime)
- pthread_t threadid;
- void **thread_return;
- const struct timespec *abstime;
+pthread_timedjoin_np (pthread_t threadid, void **thread_return,
+ const struct timespec *abstime)
{
struct pthread *self;
struct pthread *pd = (struct pthread *) threadid;
/* Wait for the thread to finish. If it is already locked something
is wrong. There can only be one waiter. */
- if (__builtin_expect (atomic_compare_and_exchange_acq (&pd->joinid, self,
- NULL) != 0, 0))
+ if (__builtin_expect (atomic_compare_and_exchange_bool_acq (&pd->joinid,
+ self, NULL), 0))
/* There is already somebody waiting for the thread. */
return EINVAL;