Skip to content

Commit

Permalink
updated to v2.9.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
GerHobbelt committed Jun 6, 2012
1 parent 0aa374a commit 3ef72b4
Show file tree
Hide file tree
Showing 22 changed files with 350 additions and 188 deletions.
31 changes: 16 additions & 15 deletions ANNOUNCE
@@ -1,8 +1,8 @@
PTHREADS-WIN32 RELEASE 2.9.0 (2007-??-??) PTHREADS-WIN32 RELEASE 2.9.0 (2012-05-25)
----------------------------------------- -----------------------------------------
Web Site: http://sources.redhat.com/pthreads-win32/ Web Site: http://sourceware.org/pthreads-win32/
FTP Site: ftp://sources.redhat.com/pub/pthreads-win32 FTP Site: ftp://sourceware.org/pub/pthreads-win32
Maintainer: Ross Johnson <rpj@callisto.canberra.edu.au> Maintainer: Ross Johnson <ross.johnson@loungebythelake.net>




We are pleased to announce the availability of a new release of We are pleased to announce the availability of a new release of
Expand All @@ -23,7 +23,7 @@ General Public License (LGPL).
Acknowledgements Acknowledgements
---------------- ----------------
This library is based originally on a Win32 pthreads This library is based originally on a Win32 pthreads
implementation contributed by John Bossom <John.Bossom@cognos.com>. implementation contributed by John Bossom.


The implementation of Condition Variables uses algorithms developed The implementation of Condition Variables uses algorithms developed
by Alexander Terekhov and Louis Thomas. by Alexander Terekhov and Louis Thomas.
Expand All @@ -50,7 +50,7 @@ were extracted from it.
There is also a separate CONTRIBUTORS file. This file and others are There is also a separate CONTRIBUTORS file. This file and others are
on the web site: on the web site:


http://sources.redhat.com/pthreads-win32 http://sourceware.org/pthreads-win32


As much as possible, the ChangeLog file acknowledges contributions to the As much as possible, the ChangeLog file acknowledges contributions to the
code base in more detail. code base in more detail.
Expand Down Expand Up @@ -274,14 +274,15 @@ The following functions are implemented:
PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_MUTEX_ADAPTIVE_NP,
PTHREAD_MUTEX_TIMED_NP) PTHREAD_MUTEX_TIMED_NP)
pthread_num_processors_np pthread_num_processors_np
pthread_win32_process_attach_np (Required when statically linking (The following four routines may be required when linking statically.
the library) The process_* routines should not be needed for MSVC or GCC.)
pthread_win32_process_detach_np (Required when statically linking pthread_win32_process_attach_np
the library) pthread_win32_process_detach_np
pthread_win32_thread_attach_np (Required when statically linking (The following routines should only be needed to manage implicit
the library) POSIX handles i.e. when Win native threads call POSIX thread routines
pthread_win32_thread_detach_np (Required when statically linking (other than pthread_create))
the library) pthread_win32_thread_attach_np
pthread_win32_thread_detach_np


--------------------------- ---------------------------
Static Initializers Static Initializers
Expand Down
17 changes: 17 additions & 0 deletions ChangeLog
@@ -1,3 +1,20 @@
2012-03-18 Ross Johnson <ross dot johnson at homemail dot com dot au>

* create.c (pthread_create): add __cdecl attribute to thread routine
arg
* implement.h (pthread_key_t): add __cdecl attribute to destructor
element
(ThreadParms): likewise for start element
* pthread.h (pthread_create): add __cdecl to prototype start arg
(pthread_once): likewise for init_routine arg
(pthread_key_create): likewise for destructor arg
(ptw32_cleanup_push): replace type of routine arg with previously
defined ptw32_cleanup_callback_t
* pthread_key_create.c: add __cdecl attribute to destructor arg
* pthread_once.c: add __cdecl attribute to init_routine arg
* ptw32_threadStart.c (start): add __cdecl to start variable type


2011-07-06 Ross Johnson <ross dot johnson at homemail dot com dot au> 2011-07-06 Ross Johnson <ross dot johnson at homemail dot com dot au>


* pthread_cond_wait.c (pragma inline_depth): this is almost redundant * pthread_cond_wait.c (pragma inline_depth): this is almost redundant
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Expand Up @@ -515,7 +515,7 @@ tests:
$(CC) -c $(CFLAGS) -DPTW32_BUILD_INLINED -Wa,-ahl $^ > $@ $(CC) -c $(CFLAGS) -DPTW32_BUILD_INLINED -Wa,-ahl $^ > $@


%.o: %.rc %.o: %.rc
$(RC) $(RCFLAGS) $(CLEANUP) -o $@ $< $(RC) $(RCFLAGS) $(CLEANUP) -o $@ -i $<


.SUFFIXES: .dll .rc .c .o .SUFFIXES: .dll .rc .c .o


Expand Down
4 changes: 3 additions & 1 deletion Makefile
Expand Up @@ -488,8 +488,10 @@ $(STATIC_STAMPS): $(DLL_INLINED_OBJS)
.c.obj: .c.obj:
$(CC) $(EHFLAGS) /D$(CLEANUP) -c $< $(CC) $(EHFLAGS) /D$(CLEANUP) -c $<


# TARGET_CPU is an environment variable set by Visual Studio Command Prompt
# as provided by the SDK
.rc.res: .rc.res:
rc /dPTW32_RC_MSC /d$(CLEANUP) $< rc /dPTW32_ARCH$(TARGET_CPU) /dPTW32_RC_MSC /d$(CLEANUP) $<


.c.i: .c.i:
$(CC) /P /O2 /Ob1 $(VCFLAGS) $< $(CC) /P /O2 /Ob1 $(VCFLAGS) $<
Expand Down
34 changes: 15 additions & 19 deletions NEWS
@@ -1,43 +1,39 @@
CURRENT CVS HEAD Version RELEASE 2.9.0
RELEASE 2.9.0 pending
------------- -------------
(2011-??-??) (2012-05-25)


General General
------- -------
New bug fixes in this release since 2.8.0 have NOT been applied to the New bug fixes in this release since 2.8.0 have NOT been applied to the
1.x.x series. 1.x.x series.


Version 2.8.0 may be the last release for some older Windows systems.
Some changes post 2011-02-26 in CVS may not be compatible with pre Some changes post 2011-02-26 in CVS may not be compatible with pre
Windows 2000 systems. Windows 2000 systems.


Version 1 no longer maintained Use of other than the "C" version of the library is now discouraged.
------------------------------ That is, the "C++" version fails some tests and does not provide any
The 1.x.x series is no longer maintained. However, if you really need a additional functionality.
version 1, the differences between 1.11.0 and 2.7.0 are very small, mainly
revolving around the pthread_once_t_ struct. Those differences applied
as a patch to the current 2.x.x should work. Don't forget to change
the version numbering in pthread.h before building. If you distribute
such a version 1.x.x please bear in mind that your numbers may clash
with those of others doing the same thing. Please consider also making
identifying changes in version.rc to differentiate your build.


Testing and verification Testing and verification
------------------------ ------------------------
The current CVS head version has been tested on an SMP architecture This version has been tested on SMP architecture (Intel x64 Hex Core)
(AMD Phenom 9750 Quad Core) by running the MinGW32 (GCC) builds against by completing the included test suite, stress and bench tests.
the full test suite, stress tests and benchmarks.


New Features New Features
------------ ------------
DLL properties now properly includes the target architecture, i.e.
right-click on the file pthreadVC2.dll in explorer and choose the Detail
tab will show the compiler and architecture in the description field, e.g.
"MS C x64" or "MS C x86".
- Ross Johnson

(MSC and GNU builds) The statically linked library now automatically (MSC and GNU builds) The statically linked library now automatically
initialises and cleans up on program start/exit, i.e. statically linked initialises and cleans up on program start/exit, i.e. statically linked
applications need not call the routines pthread_win32_process_attach_np() applications need not call the routines pthread_win32_process_attach_np()
and pthread_win32_process_detach_np() explicitly. The per-thread routine and pthread_win32_process_detach_np() explicitly. The per-thread routine
pthread_win32_thread_detach_np() is also called at program exit to cleanup pthread_win32_thread_detach_np() is also called at program exit to cleanup
POSIX resources acquired by the primary Windows native thread (if I (RJ) POSIX resources acquired by the primary Windows native thread, if I (RJ)
understand the process correctly). Other Windows native threads that call understand the process correctly. Other Windows native threads that call
POSIX API routines may need to call the thread detach routine on thread POSIX API routines may need to call the thread detach routine on thread
exit if the application depends on reclaimed POSIX resources or running exit if the application depends on reclaimed POSIX resources or running
POSIX TSD (TLS) destructors. POSIX TSD (TLS) destructors.
Expand Down
18 changes: 9 additions & 9 deletions create.c
Expand Up @@ -10,25 +10,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32 * Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom * Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors * Copyright(C) 1999,2005 Pthreads-win32 contributors
* *
* Contact Email: rpj@callisto.canberra.edu.au * Contact Email: rpj@callisto.canberra.edu.au
* *
* The current list of contributors is contained * The current list of contributors is contained
* in the file CONTRIBUTORS included with the source * in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the * code distribution. The list can also be seen at the
* following World Wide Web location: * following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html * http://sources.redhat.com/pthreads-win32/contributors.html
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB; * License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc., * if not, write to the Free Software Foundation, Inc.,
Expand All @@ -44,7 +44,7 @@
int int
pthread_create (pthread_t * tid, pthread_create (pthread_t * tid,
const pthread_attr_t * attr, const pthread_attr_t * attr,
void *(*start) (void *), void *arg) void *(PTW32_CDECL *start) (void *), void *arg)
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* DOCPUBLIC * DOCPUBLIC
Expand Down Expand Up @@ -200,7 +200,7 @@ pthread_create (pthread_t * tid,
* finished with it here. * finished with it here.
*/ */


#if ! (defined (__MINGW64__) || defined(__MINGW32__)) || defined (__MSVCRT__) || defined (__DMC__) #if ! (defined (__MINGW64__) || defined(__MINGW32__)) || defined (__MSVCRT__) || defined (__DMC__)


tp->threadH = tp->threadH =
threadH = threadH =
Expand Down Expand Up @@ -252,14 +252,14 @@ pthread_create (pthread_t * tid,
{ {
if (!run) if (!run)
{ {
/* /*
* beginthread does not allow for create flags, so we do it now. * beginthread does not allow for create flags, so we do it now.
* Note that beginthread itself creates the thread in SUSPENDED * Note that beginthread itself creates the thread in SUSPENDED
* mode, and then calls ResumeThread to start it. * mode, and then calls ResumeThread to start it.
*/ */
SuspendThread (threadH); SuspendThread (threadH);
} }

if (a != NULL) if (a != NULL)
{ {
(void) ptw32_setthreadpriority (thread, SCHED_OTHER, priority); (void) ptw32_setthreadpriority (thread, SCHED_OTHER, priority);
Expand Down
16 changes: 12 additions & 4 deletions implement.h
Expand Up @@ -97,11 +97,19 @@ typedef VOID (APIENTRY *PAPCFUNC)(DWORD dwParam);
#define PTW32_INTERLOCKED_VOLATILE volatile #define PTW32_INTERLOCKED_VOLATILE volatile
#endif #endif
#define PTW32_INTERLOCKED_LONG long #define PTW32_INTERLOCKED_LONG long
#if defined(_M_IA64)
#define PTW32_INTERLOCKED_SIZE LONG64
#elif defined(_M_AMD64)
#define PTW32_INTERLOCKED_SIZE LONG64
#else
#define PTW32_INTERLOCKED_SIZE LONG #define PTW32_INTERLOCKED_SIZE LONG
#endif
#define PTW32_INTERLOCKED_PVOID PVOID #define PTW32_INTERLOCKED_PVOID PVOID
#define PTW32_INTERLOCKED_LONGPTR PTW32_INTERLOCKED_VOLATILE long* #define PTW32_INTERLOCKED_LONGPTR PTW32_INTERLOCKED_VOLATILE long*
#if defined(_WIN64) #if defined(_M_IA64)
#define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE LONGLONG* #define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE LONG64*
#elif defined(_M_AMD64)
#define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE LONG64*
#else #else
#define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE LONG* #define PTW32_INTERLOCKED_SIZEPTR PTW32_INTERLOCKED_VOLATILE LONG*
#endif #endif
Expand Down Expand Up @@ -336,7 +344,7 @@ struct pthread_barrierattr_t_
struct pthread_key_t_ struct pthread_key_t_
{ {
DWORD key; DWORD key;
void (*destructor) (void *); void (PTW32_CDECL *destructor) (void *);
ptw32_mcs_lock_t keyLock; ptw32_mcs_lock_t keyLock;
void *threads; void *threads;
}; };
Expand All @@ -347,7 +355,7 @@ typedef struct ThreadParms ThreadParms;
struct ThreadParms struct ThreadParms
{ {
pthread_t tid; pthread_t tid;
void *(*start) (void *); void *(PTW32_CDECL *start) (void *);
void *arg; void *arg;
}; };


Expand Down
18 changes: 9 additions & 9 deletions pthread.h
Expand Up @@ -37,8 +37,8 @@
* See the README file for an explanation of the pthreads-win32 version * See the README file for an explanation of the pthreads-win32 version
* numbering scheme and how the DLL is named etc. * numbering scheme and how the DLL is named etc.
*/ */
#define PTW32_VERSION 2,9,0,0 #define PTW32_VERSION 2,9,1,0
#define PTW32_VERSION_STRING "2, 9, 0, 0\0" #define PTW32_VERSION_STRING "2, 9, 1, 0\0"


/* There are three implementations of cancel cleanup. /* There are three implementations of cancel cleanup.
* Note that pthread.h is included in both application * Note that pthread.h is included in both application
Expand Down Expand Up @@ -773,7 +773,7 @@ struct ptw32_cleanup_t
{ \ { \
ptw32_cleanup_t _cleanup; \ ptw32_cleanup_t _cleanup; \
\ \
_cleanup.routine = _rout; \ _cleanup.routine = (ptw32_cleanup_callback_t)(_rout); \
_cleanup.arg = (_arg); \ _cleanup.arg = (_arg); \
__try \ __try \
{ \ { \
Expand Down Expand Up @@ -801,7 +801,7 @@ struct ptw32_cleanup_t
{ \ { \
ptw32_cleanup_t _cleanup; \ ptw32_cleanup_t _cleanup; \
\ \
ptw32_push_cleanup( &_cleanup, _rout, (_arg) ); \ ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t) (_rout), (_arg) ); \


#define pthread_cleanup_pop( _execute ) \ #define pthread_cleanup_pop( _execute ) \
(void) ptw32_pop_cleanup( _execute ); \ (void) ptw32_pop_cleanup( _execute ); \
Expand Down Expand Up @@ -878,7 +878,7 @@ struct ptw32_cleanup_t
*/ */
#define pthread_cleanup_push( _rout, _arg ) \ #define pthread_cleanup_push( _rout, _arg ) \
{ \ { \
PThreadCleanup cleanup(_rout, \ PThreadCleanup cleanup((ptw32_cleanup_callback_t)(_rout), \
(void *) (_arg) ); (void *) (_arg) );


#define pthread_cleanup_pop( _execute ) \ #define pthread_cleanup_pop( _execute ) \
Expand Down Expand Up @@ -957,7 +957,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_attr_getscope (const pthread_attr_t *,
*/ */
PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid, PTW32_DLLPORT int PTW32_CDECL pthread_create (pthread_t * tid,
const pthread_attr_t * attr, const pthread_attr_t * attr,
void *(*start) (void *), void *(PTW32_CDECL *start) (void *),
void *arg); void *arg);


PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid); PTW32_DLLPORT int PTW32_CDECL pthread_detach (pthread_t tid);
Expand All @@ -983,21 +983,21 @@ PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type,
PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void); PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void);


PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control, PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control,
void (*init_routine) (void)); void (PTW32_CDECL *init_routine) (void));


#if PTW32_LEVEL >= PTW32_LEVEL_MAX #if PTW32_LEVEL >= PTW32_LEVEL_MAX
PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute); PTW32_DLLPORT ptw32_cleanup_t * PTW32_CDECL ptw32_pop_cleanup (int execute);


PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup, PTW32_DLLPORT void PTW32_CDECL ptw32_push_cleanup (ptw32_cleanup_t * cleanup,
void (*routine) (void *), ptw32_cleanup_callback_t routine,
void *arg); void *arg);
#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */ #endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */


/* /*
* Thread Specific Data Functions * Thread Specific Data Functions
*/ */
PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key, PTW32_DLLPORT int PTW32_CDECL pthread_key_create (pthread_key_t * key,
void (*destructor) (void *)); void (PTW32_CDECL *destructor) (void *));


PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key); PTW32_DLLPORT int PTW32_CDECL pthread_key_delete (pthread_key_t key);


Expand Down
12 changes: 6 additions & 6 deletions pthread_key_create.c
Expand Up @@ -9,25 +9,25 @@
* Pthreads-win32 - POSIX Threads Library for Win32 * Pthreads-win32 - POSIX Threads Library for Win32
* Copyright(C) 1998 John E. Bossom * Copyright(C) 1998 John E. Bossom
* Copyright(C) 1999,2005 Pthreads-win32 contributors * Copyright(C) 1999,2005 Pthreads-win32 contributors
* *
* Contact Email: rpj@callisto.canberra.edu.au * Contact Email: rpj@callisto.canberra.edu.au
* *
* The current list of contributors is contained * The current list of contributors is contained
* in the file CONTRIBUTORS included with the source * in the file CONTRIBUTORS included with the source
* code distribution. The list can also be seen at the * code distribution. The list can also be seen at the
* following World Wide Web location: * following World Wide Web location:
* http://sources.redhat.com/pthreads-win32/contributors.html * http://sources.redhat.com/pthreads-win32/contributors.html
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version. * version 2 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB; * License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc., * if not, write to the Free Software Foundation, Inc.,
Expand All @@ -44,7 +44,7 @@
#endif #endif


int int
pthread_key_create (pthread_key_t * key, void (*destructor) (void *)) pthread_key_create (pthread_key_t * key, void (PTW32_CDECL *destructor) (void *))
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* DOCPUBLIC * DOCPUBLIC
Expand Down

0 comments on commit 3ef72b4

Please sign in to comment.