From 1bc29dadbf50406f3b04f12c44efb6057a74612e Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 26 Mar 2011 07:43:44 +0000 Subject: rename function --- ANNOUNCE | 2 +- ChangeLog | 4 ++-- GNUmakefile | 4 ++-- Makefile | 4 ++-- NEWS | 2 +- nonportable.c | 2 +- pthread.h | 2 +- pthread_getsequence_np.c | 47 ----------------------------------------------- pthread_getunique_np.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 57 insertions(+), 57 deletions(-) delete mode 100755 pthread_getsequence_np.c create mode 100755 pthread_getunique_np.c diff --git a/ANNOUNCE b/ANNOUNCE index 6cb102b..3fa6232 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -266,7 +266,7 @@ The following functions are implemented: pthread_getw32threadhandle_np pthread_timechange_handler_np pthread_delay_np - pthread_getsequence_np + pthread_getunique_np pthread_mutexattr_getkind_np pthread_mutexattr_setkind_np (types: PTHREAD_MUTEX_FAST_NP, PTHREAD_MUTEX_ERRORCHECK_NP, diff --git a/ChangeLog b/ChangeLog index d143ea2..5905825 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,9 @@ 2011-03-26 Ross Johnson - * pthread_getsequence_np.c: New non-POSIX interface for compatibility + * pthread_getunique_np.c: New non-POSIX interface for compatibility with some other implementations; returns a 64 bit sequence number that is unique to each thread in the process. - * pthread.h (pthread_getsequence_np): Added. + * pthread.h (pthread_getunique_np): Added. * global.c: Add global sequence counter for above. * implement.h: Likewise. diff --git a/GNUmakefile b/GNUmakefile index 3491efd..6288ded 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -194,7 +194,7 @@ SMALL_STATIC_OBJS = \ pthread_mutexattr_setkind_np.o \ pthread_mutexattr_getkind_np.o \ pthread_getw32threadhandle_np.o \ - pthread_getsequence_np.o \ + pthread_getunique_np.o \ pthread_delay_np.o \ pthread_num_processors_np.o \ pthread_win32_attach_detach_np.o \ @@ -354,7 +354,7 @@ NONPORTABLE_SRCS = \ pthread_mutexattr_setkind_np.c \ pthread_mutexattr_getkind_np.c \ pthread_getw32threadhandle_np.c \ - pthread_getsequence_np.c \ + pthread_getunique_np.c \ pthread_delay_np.c \ pthread_num_processors_np.c \ pthread_win32_attach_detach_np.c \ diff --git a/Makefile b/Makefile index f7c6dc3..a7fb483 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,7 @@ SMALL_STATIC_OBJS = \ pthread_mutexattr_setkind_np.obj \ pthread_mutexattr_getkind_np.obj \ pthread_getw32threadhandle_np.obj \ - pthread_getsequence_np.obj \ + pthread_getunique_np.obj \ pthread_delay_np.obj \ pthread_num_processors_np.obj \ pthread_win32_attach_detach_np.obj \ @@ -296,7 +296,7 @@ NONPORTABLE_SRCS = \ pthread_mutexattr_setkind_np.c \ pthread_mutexattr_getkind_np.c \ pthread_getw32threadhandle_np.c \ - pthread_getsequence_np.c \ + pthread_getunique_np.c \ pthread_delay_np.c \ pthread_num_processors_np.c \ pthread_win32_attach_detach_np.c \ diff --git a/NEWS b/NEWS index 675cf68..221f251 100644 --- a/NEWS +++ b/NEWS @@ -56,7 +56,7 @@ types when the mutex is robust, whereas this does not occur for the "normal" non-robust mutex type. - Ross Johnson -pthread_getsequence_np is implemented for source level compatibility +pthread_getunique_np is implemented for source level compatibility with some other implementations. This routine returns a 64 bit sequence number that is uniquely associated with a thread. It can be used by applications to order or hash POSIX thread handles. diff --git a/nonportable.c b/nonportable.c index 82c558b..742cb96 100644 --- a/nonportable.c +++ b/nonportable.c @@ -40,7 +40,7 @@ #include "pthread_mutexattr_setkind_np.c" #include "pthread_mutexattr_getkind_np.c" #include "pthread_getw32threadhandle_np.c" -#include "pthread_getsequence_np.c" +#include "pthread_getunique_np.c" #include "pthread_delay_np.c" #include "pthread_num_processors_np.c" #include "pthread_win32_attach_detach_np.c" diff --git a/pthread.h b/pthread.h index a3506b6..d4b5899 100644 --- a/pthread.h +++ b/pthread.h @@ -1176,7 +1176,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutexattr_getkind_np(pthread_mutexattr_t * */ PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval); PTW32_DLLPORT int PTW32_CDECL pthread_num_processors_np(void); -PTW32_DLLPORT unsigned long long PTW32_CDECL pthread_getsequence_np(pthread_t thread); +PTW32_DLLPORT unsigned long long PTW32_CDECL pthread_getunique_np(pthread_t thread); /* * Useful if an application wants to statically link diff --git a/pthread_getsequence_np.c b/pthread_getsequence_np.c deleted file mode 100755 index 0e643e9..0000000 --- a/pthread_getsequence_np.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * pthread_getsequence_np.c - * - * Description: - * This translation unit implements non-portable thread functions. - * - * -------------------------------------------------------------------------- - * - * Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright(C) 1998 John E. Bossom - * Copyright(C) 1999,2005 Pthreads-win32 contributors - * - * Contact Email: rpj@callisto.canberra.edu.au - * - * The current list of contributors is contained - * in the file CONTRIBUTORS included with the source - * code distribution. The list can also be seen at the - * following World Wide Web location: - * http://sources.redhat.com/pthreads-win32/contributors.html - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library in the file COPYING.LIB; - * if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include "pthread.h" -#include "implement.h" - -/* - * - */ -unsigned long long -pthread_getsequence_np (pthread_t thread) -{ - return ((ptw32_thread_t*)thread.p)->seqNumber; -} diff --git a/pthread_getunique_np.c b/pthread_getunique_np.c new file mode 100755 index 0000000..f81fc61 --- /dev/null +++ b/pthread_getunique_np.c @@ -0,0 +1,47 @@ +/* + * pthread_getunique_np.c + * + * Description: + * This translation unit implements non-portable thread functions. + * + * -------------------------------------------------------------------------- + * + * Pthreads-win32 - POSIX Threads Library for Win32 + * Copyright(C) 1998 John E. Bossom + * Copyright(C) 1999,2005 Pthreads-win32 contributors + * + * Contact Email: rpj@callisto.canberra.edu.au + * + * The current list of contributors is contained + * in the file CONTRIBUTORS included with the source + * code distribution. The list can also be seen at the + * following World Wide Web location: + * http://sources.redhat.com/pthreads-win32/contributors.html + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library in the file COPYING.LIB; + * if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include "pthread.h" +#include "implement.h" + +/* + * + */ +unsigned long long +pthread_getunique_np (pthread_t thread) +{ + return ((ptw32_thread_t*)thread.p)->seqNumber; +} -- cgit v1.2.3