Browse files

See ChangeLog

  • Loading branch information...
1 parent 27d855f commit d147c9d9f50fbcf063021c31b0e076178d7e3c43 rpj committed Jan 6, 2007
View
2 ANNOUNCE
@@ -1,4 +1,4 @@
- PTHREADS-WIN32 RELEASE 2.8.0 (2006-12-22)
+ PTHREADS-WIN32 RELEASE 2.9.0 (2007-??-??)
-----------------------------------------
Web Site: http://sources.redhat.com/pthreads-win32/
FTP Site: ftp://sources.redhat.com/pub/pthreads-win32
View
44 ChangeLog
@@ -1,3 +1,47 @@
+2007-01-06 Ross Johnson <ross.johnson at homemail dot com dot au>
+
+ * ptw32_semwait.c: Add check for invalid sem_t after acquiring the
+ sem_t state guard mutex and before affecting changes to sema state.
+
+2007-01-06 Marcel Ruff <mr at marcelruff dot info>
+
+ * error.c: Fix reference to pthread handle exitStatus member for
+ builds that use NEED_ERRNO (i.e. WINCE).
+ * context.h: Add support for ARM processor (WinCE).
+ * mutex.c (process.h): Exclude for WINCE.
+ * create.c: Likewise.
+ * exit.c: Likewise.
+ * implement.h: Likewise.
+ * pthread_detach.c (signal.h): Exclude for WINCE.
+ * pthread_join.c: Likewise.
+ * pthread_kill.c: Likewise.
+ * pthread_rwlock_init.c (errno.h): Remove - included by pthread.h.
+ * pthread_rwlock_destroy.c: Likewise.
+ * pthread_rwlock_rdlock.c: Likewise.
+ * pthread_rwlock_timedrdlock.c: Likewise.
+ * pthread_rwlock_timedwrlock.c: Likewise.
+ * pthread_rwlock_tryrdlock.c: Likewise.
+ * pthread_rwlock_trywrlock.c: likewise.
+ * pthread_rwlock_unlock.c: Likewise.
+ * pthread_rwlock_wrlock.c: Likewise.
+ * pthread_rwlockattr_destroy.c: Likewise.
+ * pthread_rwlockattr_getpshared.c: Likewise.
+ * pthread_rwlockattr_init.c: Likewise.
+ * pthread_rwlockattr_setpshared.c: Likewise.
+
+2007-01-06 Romano Paolo Tenca <rotenca at telvia dot it>
+
+ * pthread_cond_destroy.c: Replace sem_wait() with non-cancelable
+ ptw32_semwait() since pthread_cond_destroy() is not a cancelation
+ point.
+ * implement.h (ptw32_spinlock_check_need_init): Add prototype.
+ * ptw32_MCS_lock.c: Reverse order of includes.
+
+2007-01-06 Eric Berge <eric dot berge at quantum dot com>
+
+ * pthread_cond_destroy.c: Add LeaveCriticalSection before returning
+ after errors.
+
2007-01-04 Ross Johnson <ross.johnson at homemail dot com dot au>
* ptw32_InterlockedCompareExchange.c: Conditionally skip for
View
2 Makefile
@@ -27,7 +27,7 @@ STATIC_STAMPS = pthreadVCE$(DLL_VER).static pthreadVSE$(DLL_VER).static pthreadV
OPTIM = /O2 /Ob2
OPTIMD =
-CFLAGS = /W3 /MD /nologo /Yd /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
+CFLAGS = /W3 /MD /nologo /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
CFLAGSD = /Zi $(CFLAGS)
View
6 context.h
@@ -47,7 +47,7 @@
#define PTW32_PROGCTR(Context) ((Context).StIIP)
#endif
-#if defined(_MIPS_)
+#if defined(_MIPS_) || defined(MIPS)
#define PTW32_PROGCTR(Context) ((Context).Fir)
#endif
@@ -63,6 +63,10 @@
#define PTW32_PROGCTR(Context) ((Context).Rip)
#endif
+#if defined(_ARM_) || defined(ARM)
+#define PTW32_PROGCTR(Context) ((Context).Pc)
+#endif
+
#if !defined(PTW32_PROGCTR)
#error Module contains CPU-specific code; modify and recompile.
#endif
View
2 create.c
@@ -37,7 +37,7 @@
#include "pthread.h"
#include "implement.h"
-#ifndef _UWIN
+#if ! defined(_UWIN) && ! defined(WINCE)
#include <process.h>
#endif
View
2 errno.c
@@ -84,7 +84,7 @@ _errno (void)
}
else
{
- result = &(self->ptErrno);
+ result = (int *)(&self.p->exitStatus);
}
return (result);
View
2 exit.c
@@ -37,7 +37,7 @@
#include "pthread.h"
#include "implement.h"
-#ifndef _UWIN
+#if ! defined(_UWIN) && ! defined(WINCE)
# include <process.h>
#endif
View
25 implement.h
@@ -566,6 +566,7 @@ extern "C"
int ptw32_cond_check_need_init (pthread_cond_t * cond);
int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
+ int ptw32_spinlock_check_need_init (pthread_spinlock_t * spinlock);
PTW32_INTERLOCKED_LONG WINAPI
ptw32_InterlockedCompareExchange (PTW32_INTERLOCKED_LPLONG location,
@@ -658,7 +659,9 @@ extern "C"
# endif
# endif
#else
-# include <process.h>
+# ifndef WINCE
+# include <process.h>
+# endif
#endif
@@ -667,11 +670,21 @@ extern "C"
* See ptw32_InterlockedCompareExchange.c
*/
#ifndef PTW32_INTERLOCKED_COMPARE_EXCHANGE
-#ifdef _WIN64
-#define PTW32_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
-#else
-#define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_interlocked_compare_exchange
-#endif
+# ifdef _WIN64
+ /*
+ * InterlockedCompareExchange is an intrinsic function in Win64.
+ */
+# define PTW32_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange
+# else
+ /*
+ * The routine pthread_win32_process_attach_np() in pthread_win32_attach_detach_np.c
+ * checks at runtime that InterlockedCompareExchange is supported within
+ * KERNEL32.DLL (or COREDLL.DLL for WinCE). This allows the same
+ * dll to run on all Win32 versions from Win95 onwards. Not sure if this
+ * is required for WinCE, but should work just the same anyway.
+ */
+# define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_interlocked_compare_exchange
+# endif
#endif
#ifndef PTW32_INTERLOCKED_EXCHANGE
View
2 mutex.c
@@ -34,7 +34,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#ifndef _UWIN
+#if ! defined(_UWIN) && ! defined(WINCE)
# include <process.h>
#endif
#ifndef NEED_FTIME
View
4 pthread.h
@@ -37,8 +37,8 @@
* See the README file for an explanation of the pthreads-win32 version
* numbering scheme and how the DLL is named etc.
*/
-#define PTW32_VERSION 2,8,0,0
-#define PTW32_VERSION_STRING "2, 8, 0, 0\0"
+#define PTW32_VERSION 2,9,0,0
+#define PTW32_VERSION_STRING "2, 9, 0, 0\0"
/* There are three implementations of cancel cleanup.
* Note that pthread.h is included in both application
View
31 pthread_cond_destroy.c
@@ -135,21 +135,28 @@ pthread_cond_destroy (pthread_cond_t * cond)
* all already signaled waiters to let them retract their
* waiter status - SEE NOTE 1 ABOVE!!!
*/
- if (sem_wait (&(cv->semBlockLock)) != 0)
+ if (ptw32_semwait (&(cv->semBlockLock)) != 0) /* Non-cancelable */
{
- return errno;
+ result = errno;
}
-
- /*
- * !TRY! lock mtxUnblockLock; try will detect busy condition
- * and will not cause a deadlock with respect to concurrent
- * signal/broadcast.
- */
- if ((result = pthread_mutex_trylock (&(cv->mtxUnblockLock))) != 0)
- {
- (void) sem_post (&(cv->semBlockLock));
- return result;
+ else
+ {
+ /*
+ * !TRY! lock mtxUnblockLock; try will detect busy condition
+ * and will not cause a deadlock with respect to concurrent
+ * signal/broadcast.
+ */
+ if ((result = pthread_mutex_trylock (&(cv->mtxUnblockLock))) != 0)
+ {
+ (void) sem_post (&(cv->semBlockLock));
+ }
}
+
+ if (result != 0)
+ {
+ LeaveCriticalSection (&ptw32_cond_list_lock);
+ return result;
+ }
/*
* Check whether cv is still busy (still has waiters)
View
4 pthread_detach.c
@@ -42,7 +42,9 @@
* Not needed yet, but defining it should indicate clashes with build target
* environment that should be fixed.
*/
-#include <signal.h>
+#ifndef WINCE
+# include <signal.h>
+#endif
int
View
4 pthread_join.c
@@ -42,7 +42,9 @@
* Not needed yet, but defining it should indicate clashes with build target
* environment that should be fixed.
*/
-#include <signal.h>
+#ifndef WINCE
+# include <signal.h>
+#endif
int
View
4 pthread_kill.c
@@ -41,7 +41,9 @@
* Not needed yet, but defining it should indicate clashes with build target
* environment that should be fixed.
*/
-#include <signal.h>
+#ifndef WINCE
+# include <signal.h>
+#endif
int
pthread_kill (pthread_t thread, int sig)
View
1 pthread_rwlock_destroy.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_init.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_rdlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_timedrdlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_timedwrlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_tryrdlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_trywrlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_unlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlock_wrlock.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlockattr_destroy.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlockattr_getpshared.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlockattr_init.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
1 pthread_rwlockattr_setpshared.c
@@ -34,7 +34,6 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <errno.h>
#include <limits.h>
#include "pthread.h"
View
2 ptw32_MCS_lock.c
@@ -89,8 +89,8 @@
* }
*/
-#include "implement.h"
#include "pthread.h"
+#include "implement.h"
/*
* ptw32_mcs_flag_set -- notify another thread about an event.
View
19 ptw32_semwait.c
@@ -77,8 +77,18 @@ ptw32_semwait (sem_t * sem)
{
if ((result = pthread_mutex_lock (&s->lock)) == 0)
{
- int v = --s->value;
+ int v;
+ /* See sem_destroy.c
+ */
+ if (*sem == NULL)
+ {
+ (void) pthread_mutex_unlock (&s->lock);
+ errno = EINVAL;
+ return -1;
+ }
+
+ v = --s->value;
(void) pthread_mutex_unlock (&s->lock);
if (v < 0)
@@ -89,6 +99,13 @@ ptw32_semwait (sem_t * sem)
#ifdef NEED_SEM
if (pthread_mutex_lock (&s->lock) == 0)
{
+ if (*sem == NULL)
+ {
+ (void) pthread_mutex_unlock (&s->lock);
+ errno = EINVAL;
+ return -1;
+ }
+
if (s->leftToUnblock > 0)
{
--s->leftToUnblock;
View
2 tests/Makefile
@@ -67,7 +67,7 @@ VCXFLAGS = /GX /TP /D__CLEANUP_C
CPLIB = $(VCLIB)
CPDLL = $(VCDLL)
-CFLAGS= $(OPTIM) /W3 /WX /MD /nologo /Yd /Zi
+CFLAGS= $(OPTIM) /W3 /WX /MD /nologo /Zi
LFLAGS= /INCREMENTAL:NO
INCLUDES=-I.
BUILD_DIR=..

0 comments on commit d147c9d

Please sign in to comment.