diff options
author | neal <neal> | 2008-01-17 01:12:43 +0000 |
---|---|---|
committer | neal <neal> | 2008-01-17 01:12:43 +0000 |
commit | 00eef7a0458f6a8c3930a4640ddce0b385a16081 (patch) | |
tree | 896416758952829b83c880e016417688787aa617 /libpthread | |
parent | 14daa7dc82e4d596e12faeb64b04773e493b9a5f (diff) |
2008-01-17 Neal H. Walfield <neal@gnu.org>
* sysdeps/l4/hurd/pt-block.c: New file.
* sysdeps/l4/hurd/pt-wakeup.c: Likewise.
Diffstat (limited to 'libpthread')
-rw-r--r-- | libpthread/ChangeLog | 5 | ||||
-rw-r--r-- | libpthread/sysdeps/l4/hurd/pt-block.c | 30 | ||||
-rw-r--r-- | libpthread/sysdeps/l4/hurd/pt-wakeup.c | 32 |
3 files changed, 67 insertions, 0 deletions
diff --git a/libpthread/ChangeLog b/libpthread/ChangeLog index 263f4bc..29c1e21 100644 --- a/libpthread/ChangeLog +++ b/libpthread/ChangeLog @@ -1,3 +1,8 @@ +2008-01-17 Neal H. Walfield <neal@gnu.org> + + * sysdeps/l4/hurd/pt-block.c: New file. + * sysdeps/l4/hurd/pt-wakeup.c: Likewise. + 2008-01-01 Neal H. Walfield <neal@gnu.org> * sysdeps/generic/pt-mutex-timedlock.c diff --git a/libpthread/sysdeps/l4/hurd/pt-block.c b/libpthread/sysdeps/l4/hurd/pt-block.c new file mode 100644 index 0000000..2315b1c --- /dev/null +++ b/libpthread/sysdeps/l4/hurd/pt-block.c @@ -0,0 +1,30 @@ +/* Block a thread. Viengoos version. + Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <pt-internal.h> + +#include <hurd/stddef.h> +#include <hurd/futex.h> + +/* Block THREAD. */ +void +__pthread_block (struct __pthread *thread) +{ + futex_wait (&thread->threadid, thread->threadid); +} diff --git a/libpthread/sysdeps/l4/hurd/pt-wakeup.c b/libpthread/sysdeps/l4/hurd/pt-wakeup.c new file mode 100644 index 0000000..2225cca --- /dev/null +++ b/libpthread/sysdeps/l4/hurd/pt-wakeup.c @@ -0,0 +1,32 @@ +/* Wakeup a thread. Viengoos version. + Copyright (C) 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <pt-internal.h> + +#include <hurd/stddef.h> +#include <hurd/futex.h> +#include <stdint.h> + +/* Wakeup THREAD. */ +void +__pthread_wakeup (struct __pthread *thread) +{ + long ret = futex_wake (&thread->threadid, INT_MAX); + assert (ret == 1); +} |