diff --git a/3rdparty/w32pthreads/attr.c b/3rdparty/w32pthreads/attr.c deleted file mode 100644 index ee1b9739f5..0000000000 --- a/3rdparty/w32pthreads/attr.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * attr.c - * - * Description: - * This translation unit agregates operations on thread attribute objects. - * It is used for inline optimisation. - * - * The included modules are used separately when static executable sizes - * must be minimised. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#include "pthread_attr_init.c" -#include "pthread_attr_destroy.c" -#include "pthread_attr_getdetachstate.c" -#include "pthread_attr_setdetachstate.c" -#include "pthread_attr_getstackaddr.c" -#include "pthread_attr_setstackaddr.c" -#include "pthread_attr_getstacksize.c" -#include "pthread_attr_setstacksize.c" -#include "pthread_attr_getscope.c" -#include "pthread_attr_setscope.c" diff --git a/3rdparty/w32pthreads/barrier.c b/3rdparty/w32pthreads/barrier.c deleted file mode 100644 index d617f45742..0000000000 --- a/3rdparty/w32pthreads/barrier.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * barrier.c - * - * Description: - * This translation unit implements barrier primitives. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#include "pthread_barrier_init.c" -#include "pthread_barrier_destroy.c" -#include "pthread_barrier_wait.c" -#include "pthread_barrierattr_init.c" -#include "pthread_barrierattr_destroy.c" -#include "pthread_barrierattr_getpshared.c" -#include "pthread_barrierattr_setpshared.c" diff --git a/3rdparty/w32pthreads/cancel.c b/3rdparty/w32pthreads/cancel.c deleted file mode 100644 index dfb5771251..0000000000 --- a/3rdparty/w32pthreads/cancel.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * cancel.c - * - * Description: - * POSIX thread functions related to thread cancellation. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#include "pthread_setcancelstate.c" -#include "pthread_setcanceltype.c" -#include "pthread_testcancel.c" -#include "pthread_cancel.c" diff --git a/3rdparty/w32pthreads/condvar.c b/3rdparty/w32pthreads/condvar.c deleted file mode 100644 index ec54e4968e..0000000000 --- a/3rdparty/w32pthreads/condvar.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * condvar.c - * - * Description: - * This translation unit implements condition variables and their primitives. - * - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#include "ptw32_cond_check_need_init.c" -#include "pthread_condattr_init.c" -#include "pthread_condattr_destroy.c" -#include "pthread_condattr_getpshared.c" -#include "pthread_condattr_setpshared.c" -#include "pthread_cond_init.c" -#include "pthread_cond_destroy.c" -#include "pthread_cond_wait.c" -#include "pthread_cond_signal.c" diff --git a/3rdparty/w32pthreads/dll.c b/3rdparty/w32pthreads/dll.c index c1cd4e96e2..50f09d0742 100644 --- a/3rdparty/w32pthreads/dll.c +++ b/3rdparty/w32pthreads/dll.c @@ -34,10 +34,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ifndef PTW32_STATIC_LIB +#include "ptw32pch.h" -#include "pthread.h" -#include "implement.h" +#ifndef PTW32_STATIC_LIB #ifdef _MSC_VER /* diff --git a/3rdparty/w32pthreads/fork.c b/3rdparty/w32pthreads/fork.c deleted file mode 100644 index 152d59d93e..0000000000 --- a/3rdparty/w32pthreads/fork.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * fork.c - * - * Description: - * Implementation of fork() for POSIX threads. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" diff --git a/3rdparty/w32pthreads/global.c b/3rdparty/w32pthreads/global.c index 4e101f6cf0..e114fc80d1 100644 --- a/3rdparty/w32pthreads/global.c +++ b/3rdparty/w32pthreads/global.c @@ -37,22 +37,22 @@ #include "ptw32pch.h" -__declspec(thread) ptw32_thread_t* ptw32_selfThread = NULL; int ptw32_processInitialized = PTW32_FALSE; ptw32_thread_t * ptw32_threadReuseTop = PTW32_THREAD_REUSE_EMPTY; ptw32_thread_t * ptw32_threadReuseBottom = PTW32_THREAD_REUSE_EMPTY; +pthread_key_t ptw32_selfThreadKey = NULL; pthread_key_t ptw32_cleanupKey = NULL; pthread_cond_t ptw32_cond_list_head = NULL; pthread_cond_t ptw32_cond_list_tail = NULL; +long ptw32_testcancel_enable = 0; + int ptw32_concurrency = 0; -/* What features have been auto-detected */ +/* What features have been auto-detaected */ int ptw32_features = 0; -BOOL ptw32_smp_system = PTW32_TRUE; /* Safer if assumed true initially. */ - #if 0 /* * Function pointer to InterlockedCompareExchange if it exists, otherwise diff --git a/3rdparty/w32pthreads/include/implement.h b/3rdparty/w32pthreads/include/implement.h index 0439fd2cbe..3b408f5f28 100644 --- a/3rdparty/w32pthreads/include/implement.h +++ b/3rdparty/w32pthreads/include/implement.h @@ -44,6 +44,7 @@ #define _WIN32_WINNT 0x400 #include +#include /* * In case windows.h doesn't define it (e.g. WinCE perhaps) @@ -136,7 +137,7 @@ struct ptw32_thread_t_ void *parms; int ptErrno; int detachState; - pthread_mutex_t threadLock; /* Used for serialized access to public thread state */ + pthread_mutex_t threadLock; /* Used for serialised access to public thread state */ int sched_priority; /* As set, not as currently is */ pthread_mutex_t cancelLock; /* Used for async-cancel safety */ int cancelState; @@ -182,6 +183,12 @@ struct pthread_attr_t_ * ==================== */ +#ifdef PTW32_STATIC_MUTEXS +# define ptw32_static_mutex_enable (1) +#else +# define ptw32_static_mutex_enable (0) +#endif + struct sem_t_ { int value; @@ -528,7 +535,8 @@ extern "C" { #endif /* __cplusplus */ -extern __declspec(thread) ptw32_thread_t* ptw32_selfThread; +PTW32_DLLPORT long ptw32_testcancel_enable; +PTW32_DLLPORT pthread_key_t ptw32_selfThreadKey; extern int ptw32_processInitialized; extern ptw32_thread_t * ptw32_threadReuseTop; @@ -543,8 +551,6 @@ extern int ptw32_concurrency; extern int ptw32_features; -extern BOOL ptw32_smp_system; /* True: SMP system, False: Uni-processor system */ - extern CRITICAL_SECTION ptw32_thread_reuse_lock; extern CRITICAL_SECTION ptw32_mutex_test_init_lock; extern CRITICAL_SECTION ptw32_cond_list_lock; @@ -568,22 +574,15 @@ extern int pthread_count; int ptw32_is_attr (const pthread_attr_t * attr); int ptw32_cond_check_need_init (pthread_cond_t * cond); - int ptw32_mutex_check_need_init (pthread_mutex_t * mutex); + PTW32_DLLPORT int ptw32_mutex_check_need_init (pthread_mutex_t * mutex); int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock); - PTW32_INTERLOCKED_LONG WINAPI - ptw32_InterlockedCompareExchange (volatile PTW32_INTERLOCKED_LPLONG location, - PTW32_INTERLOCKED_LONG value, - PTW32_INTERLOCKED_LONG comparand); - - LONG WINAPI - ptw32_InterlockedExchange (volatile PTW32_INTERLOCKED_LPLONG location, - LONG value); - DWORD ptw32_RegisterCancelation (PAPCFUNC callback, HANDLE threadH, DWORD callback_arg); + PTW32_DLLPORT void ptw32_PrepCancel( ptw32_thread_t* tp ); + int ptw32_processInitialize (void); void ptw32_processTerminate (void); @@ -640,7 +639,7 @@ extern int pthread_count; #endif /* Declared in private.c */ - void ptw32_throw (DWORD exception); + PTW32_DLLPORT void ptw32_throw (DWORD exception); #ifdef __cplusplus } @@ -675,11 +674,11 @@ extern "C" */ // Default to inlining the pthreads versions... (air) #ifndef PTW32_INTERLOCKED_COMPARE_EXCHANGE -#define PTW32_INTERLOCKED_COMPARE_EXCHANGE ptw32_InterlockedCompareExchange +#define PTW32_INTERLOCKED_COMPARE_EXCHANGE _InterlockedCompareExchange #endif #ifndef PTW32_INTERLOCKED_EXCHANGE -#define PTW32_INTERLOCKED_EXCHANGE ptw32_InterlockedExchange +#define PTW32_INTERLOCKED_EXCHANGE _InterlockedExchange #endif diff --git a/3rdparty/w32pthreads/include/pthread.h b/3rdparty/w32pthreads/include/pthread.h index 1dc22fa06b..7b2d42bad2 100644 --- a/3rdparty/w32pthreads/include/pthread.h +++ b/3rdparty/w32pthreads/include/pthread.h @@ -685,6 +685,10 @@ struct pthread_once_t_ * ==================== * ==================== */ + +// Note: Static mutexes are useful in C but a bad idea in C++, and add overhead to all +// mutex lockers (bad!), so C++ code should idisable them and use C++ initializers instead. + #define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1) #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER ((pthread_mutex_t) -2) #define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ((pthread_mutex_t) -3) @@ -951,7 +955,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_join (pthread_t thread, PTW32_DLLPORT pthread_t PTW32_CDECL pthread_self (void); -PTW32_DLLPORT int PTW32_CDECL pthread_cancel (pthread_t thread); +extern int PTW32_CDECL pthread_cancel (pthread_t thread); PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state, int *oldstate); @@ -959,7 +963,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_setcancelstate (int state, PTW32_DLLPORT int PTW32_CDECL pthread_setcanceltype (int type, int *oldtype); -PTW32_DLLPORT void PTW32_CDECL pthread_testcancel (void); +extern void PTW32_CDECL pthread_testcancel (void); PTW32_DLLPORT int PTW32_CDECL pthread_once (pthread_once_t * once_control, void (*init_routine) (void)); @@ -1025,17 +1029,22 @@ PTW32_DLLPORT int PTW32_CDECL pthread_mutex_init (pthread_mutex_t * mutex, PTW32_DLLPORT int PTW32_CDECL pthread_mutex_destroy (pthread_mutex_t * mutex); -PTW32_DLLPORT int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex); +extern int PTW32_CDECL pthread_mutex_lock (pthread_mutex_t * mutex); PTW32_DLLPORT int PTW32_CDECL pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime); -PTW32_DLLPORT int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex); +extern int PTW32_CDECL pthread_mutex_trylock (pthread_mutex_t * mutex); -PTW32_DLLPORT int PTW32_CDECL pthread_mutex_unlock (pthread_mutex_t * mutex); +extern int PTW32_CDECL pthread_mutex_unlock (pthread_mutex_t * mutex); +#ifdef PTW32_ALLOW_SPIN /* * Spinlock Functions + * + * These are disabled by default; they are not part of the "required" portion of pthreads + * implementations, and they are generally a bad idea for anything except the most controlled + * of threaded environments (which hardly exist in modern computing). */ PTW32_DLLPORT int PTW32_CDECL pthread_spin_init (pthread_spinlock_t * lock, int pshared); @@ -1046,6 +1055,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_spin_lock (pthread_spinlock_t * lock); PTW32_DLLPORT int PTW32_CDECL pthread_spin_trylock (pthread_spinlock_t * lock); PTW32_DLLPORT int PTW32_CDECL pthread_spin_unlock (pthread_spinlock_t * lock); +#endif /* * Barrier Functions @@ -1058,6 +1068,7 @@ PTW32_DLLPORT int PTW32_CDECL pthread_barrier_destroy (pthread_barrier_t * barri PTW32_DLLPORT int PTW32_CDECL pthread_barrier_wait (pthread_barrier_t * barrier); +#ifdef PTW32_ALLOW_COND /* * Condition Variable Attribute Functions */ @@ -1074,7 +1085,6 @@ PTW32_DLLPORT int PTW32_CDECL pthread_condattr_setpshared (pthread_condattr_t * /* * Condition Variable Functions */ -#ifdef PCSX2_ALLOW_COND PTW32_DLLPORT int PTW32_CDECL pthread_cond_init (pthread_cond_t * cond, const pthread_condattr_t * attr); diff --git a/3rdparty/w32pthreads/include/semaphore.h b/3rdparty/w32pthreads/include/semaphore.h index a3330a6388..232782808b 100644 --- a/3rdparty/w32pthreads/include/semaphore.h +++ b/3rdparty/w32pthreads/include/semaphore.h @@ -132,9 +132,9 @@ PTW32_DLLPORT int __cdecl sem_init (sem_t * sem, PTW32_DLLPORT int __cdecl sem_destroy (sem_t * sem); -PTW32_DLLPORT int __cdecl sem_trywait (sem_t * sem); +extern int __cdecl sem_trywait (sem_t * sem); -PTW32_DLLPORT int __cdecl sem_wait (sem_t * sem); +extern int __cdecl sem_wait (sem_t * sem); PTW32_DLLPORT int __cdecl sem_timedwait (sem_t * sem, const struct timespec * abstime); diff --git a/3rdparty/w32pthreads/misc.c b/3rdparty/w32pthreads/misc.c deleted file mode 100644 index 185b75657a..0000000000 --- a/3rdparty/w32pthreads/misc.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * misc.c - * - * Description: - * This translation unit implements miscellaneous 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 "ptw32pch.h" - - -#include "pthread_kill.c" -#include "pthread_once.c" -#include "pthread_self.c" -#include "pthread_equal.c" -#include "pthread_setconcurrency.c" -#include "pthread_getconcurrency.c" -#include "ptw32_new.c" -#include "ptw32_calloc.c" -#include "ptw32_reuse.c" -#include "w32_CancelableWait.c" diff --git a/3rdparty/w32pthreads/mutex.c b/3rdparty/w32pthreads/mutex.c deleted file mode 100644 index 15c0f449c5..0000000000 --- a/3rdparty/w32pthreads/mutex.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * mutex.c - * - * Description: - * This translation unit implements mutual exclusion (mutex) primitives. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#ifndef _UWIN -# include -#endif -#ifndef NEED_FTIME -#include -#endif - - -#include "ptw32_mutex_check_need_init.c" -#include "pthread_mutex_init.c" -#include "pthread_mutex_destroy.c" -#include "pthread_mutexattr_init.c" -#include "pthread_mutexattr_destroy.c" -#include "pthread_mutexattr_getpshared.c" -#include "pthread_mutexattr_setpshared.c" -#include "pthread_mutexattr_settype.c" -#include "pthread_mutexattr_gettype.c" -#include "pthread_mutex_lock.c" -#include "pthread_mutex_timedlock.c" -#include "pthread_mutex_unlock.c" -#include "pthread_mutex_trylock.c" diff --git a/3rdparty/w32pthreads/nonportable.c b/3rdparty/w32pthreads/nonportable.c deleted file mode 100644 index 68e86899a9..0000000000 --- a/3rdparty/w32pthreads/nonportable.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * nonportable.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 "ptw32pch.h" - -#include "pthread_mutexattr_setkind_np.c" -#include "pthread_mutexattr_getkind_np.c" -#include "pthread_getw32threadhandle_np.c" -#include "pthread_delay_np.c" -#include "pthread_num_processors_np.c" -#include "pthread_win32_attach_detach_np.c" - -// Removed due to pthread_cond reference - air -//#include "pthread_timechange_handler_np.c" diff --git a/3rdparty/w32pthreads/private.c b/3rdparty/w32pthreads/private.c deleted file mode 100644 index 8399a70160..0000000000 --- a/3rdparty/w32pthreads/private.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * private.c - * - * Description: - * This translation unit implements routines which are private to - * the implementation and may be used throughout it. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -/* Must be first to define HAVE_INLINABLE_INTERLOCKED_CMPXCHG */ -#include "ptw32_InterlockedCompareExchange.c" - -#include "ptw32_MCS_lock.c" -#include "ptw32_is_attr.c" -#include "ptw32_processInitialize.c" -#include "ptw32_processTerminate.c" -#include "ptw32_threadStart.c" -#include "ptw32_threadDestroy.c" -#include "ptw32_tkAssocCreate.c" -#include "ptw32_tkAssocDestroy.c" -#include "ptw32_callUserDestroyRoutines.c" -#include "ptw32_semwait.c" -#include "ptw32_timespec.c" -#include "ptw32_relmillisecs.c" -#include "ptw32_throw.c" -#include "ptw32_getprocessors.c" diff --git a/3rdparty/w32pthreads/pthread_attr_destroy.c b/3rdparty/w32pthreads/pthread_attr_destroy.c index 8b3e04c536..e6058aaaff 100644 --- a/3rdparty/w32pthreads/pthread_attr_destroy.c +++ b/3rdparty/w32pthreads/pthread_attr_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_getdetachstate.c b/3rdparty/w32pthreads/pthread_attr_getdetachstate.c index 978f288494..247baa8bc6 100644 --- a/3rdparty/w32pthreads/pthread_attr_getdetachstate.c +++ b/3rdparty/w32pthreads/pthread_attr_getdetachstate.c @@ -34,9 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" int pthread_attr_getdetachstate (const pthread_attr_t * attr, int *detachstate) diff --git a/3rdparty/w32pthreads/pthread_attr_getinheritsched.c b/3rdparty/w32pthreads/pthread_attr_getinheritsched.c index 5085077a66..42cd0d9c93 100644 --- a/3rdparty/w32pthreads/pthread_attr_getinheritsched.c +++ b/3rdparty/w32pthreads/pthread_attr_getinheritsched.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_getschedparam.c b/3rdparty/w32pthreads/pthread_attr_getschedparam.c index ab89b2241a..65bfc87aa6 100644 --- a/3rdparty/w32pthreads/pthread_attr_getschedparam.c +++ b/3rdparty/w32pthreads/pthread_attr_getschedparam.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_getschedpolicy.c b/3rdparty/w32pthreads/pthread_attr_getschedpolicy.c index 04adbd5c64..05e6da82d5 100644 --- a/3rdparty/w32pthreads/pthread_attr_getschedpolicy.c +++ b/3rdparty/w32pthreads/pthread_attr_getschedpolicy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_getscope.c b/3rdparty/w32pthreads/pthread_attr_getscope.c index 3c863821ed..f9b43bb0ed 100644 --- a/3rdparty/w32pthreads/pthread_attr_getscope.c +++ b/3rdparty/w32pthreads/pthread_attr_getscope.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/pthread_attr_getstackaddr.c b/3rdparty/w32pthreads/pthread_attr_getstackaddr.c index 9b5595928b..d7f1ce6776 100644 --- a/3rdparty/w32pthreads/pthread_attr_getstackaddr.c +++ b/3rdparty/w32pthreads/pthread_attr_getstackaddr.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/pthread_attr_getstacksize.c b/3rdparty/w32pthreads/pthread_attr_getstacksize.c index da8db636c8..e6f2cfc622 100644 --- a/3rdparty/w32pthreads/pthread_attr_getstacksize.c +++ b/3rdparty/w32pthreads/pthread_attr_getstacksize.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/pthread_attr_init.c b/3rdparty/w32pthreads/pthread_attr_init.c index 6c10bd3e7f..ea2b4aae31 100644 --- a/3rdparty/w32pthreads/pthread_attr_init.c +++ b/3rdparty/w32pthreads/pthread_attr_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setdetachstate.c b/3rdparty/w32pthreads/pthread_attr_setdetachstate.c index 784642a807..77f5c11105 100644 --- a/3rdparty/w32pthreads/pthread_attr_setdetachstate.c +++ b/3rdparty/w32pthreads/pthread_attr_setdetachstate.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setinheritsched.c b/3rdparty/w32pthreads/pthread_attr_setinheritsched.c index e0a407a3b7..fed03653a9 100644 --- a/3rdparty/w32pthreads/pthread_attr_setinheritsched.c +++ b/3rdparty/w32pthreads/pthread_attr_setinheritsched.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setschedparam.c b/3rdparty/w32pthreads/pthread_attr_setschedparam.c index f246bfae7a..ca10b93d50 100644 --- a/3rdparty/w32pthreads/pthread_attr_setschedparam.c +++ b/3rdparty/w32pthreads/pthread_attr_setschedparam.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setschedpolicy.c b/3rdparty/w32pthreads/pthread_attr_setschedpolicy.c index 45ff165973..62c5225312 100644 --- a/3rdparty/w32pthreads/pthread_attr_setschedpolicy.c +++ b/3rdparty/w32pthreads/pthread_attr_setschedpolicy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setscope.c b/3rdparty/w32pthreads/pthread_attr_setscope.c index 9cef423b25..f55d5a8d59 100644 --- a/3rdparty/w32pthreads/pthread_attr_setscope.c +++ b/3rdparty/w32pthreads/pthread_attr_setscope.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/pthread_attr_setstackaddr.c b/3rdparty/w32pthreads/pthread_attr_setstackaddr.c index 96a8320971..136e945e08 100644 --- a/3rdparty/w32pthreads/pthread_attr_setstackaddr.c +++ b/3rdparty/w32pthreads/pthread_attr_setstackaddr.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_attr_setstacksize.c b/3rdparty/w32pthreads/pthread_attr_setstacksize.c index 9df46afc47..5a3cd23905 100644 --- a/3rdparty/w32pthreads/pthread_attr_setstacksize.c +++ b/3rdparty/w32pthreads/pthread_attr_setstacksize.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrier_destroy.c b/3rdparty/w32pthreads/pthread_barrier_destroy.c index 9302ba7975..49e799658a 100644 --- a/3rdparty/w32pthreads/pthread_barrier_destroy.c +++ b/3rdparty/w32pthreads/pthread_barrier_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrier_init.c b/3rdparty/w32pthreads/pthread_barrier_init.c index dc1b50c6f7..b9d9362da8 100644 --- a/3rdparty/w32pthreads/pthread_barrier_init.c +++ b/3rdparty/w32pthreads/pthread_barrier_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrier_wait.c b/3rdparty/w32pthreads/pthread_barrier_wait.c index 01ae29766e..054a09963f 100644 --- a/3rdparty/w32pthreads/pthread_barrier_wait.c +++ b/3rdparty/w32pthreads/pthread_barrier_wait.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrierattr_destroy.c b/3rdparty/w32pthreads/pthread_barrierattr_destroy.c index 5ab662e3f4..b55d52b53c 100644 --- a/3rdparty/w32pthreads/pthread_barrierattr_destroy.c +++ b/3rdparty/w32pthreads/pthread_barrierattr_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrierattr_getpshared.c b/3rdparty/w32pthreads/pthread_barrierattr_getpshared.c index 44c467e2bf..12f6cab86c 100644 --- a/3rdparty/w32pthreads/pthread_barrierattr_getpshared.c +++ b/3rdparty/w32pthreads/pthread_barrierattr_getpshared.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrierattr_init.c b/3rdparty/w32pthreads/pthread_barrierattr_init.c index 342f8b0c69..b5acbde8a8 100644 --- a/3rdparty/w32pthreads/pthread_barrierattr_init.c +++ b/3rdparty/w32pthreads/pthread_barrierattr_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_barrierattr_setpshared.c b/3rdparty/w32pthreads/pthread_barrierattr_setpshared.c index 08c6fde30b..0d96c996b0 100644 --- a/3rdparty/w32pthreads/pthread_barrierattr_setpshared.c +++ b/3rdparty/w32pthreads/pthread_barrierattr_setpshared.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_cancel.c b/3rdparty/w32pthreads/pthread_cancel.c index 1118977ee5..af3ac74463 100644 --- a/3rdparty/w32pthreads/pthread_cancel.c +++ b/3rdparty/w32pthreads/pthread_cancel.c @@ -34,69 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - -#if defined(_M_IX86) || defined(_X86_) -#define PTW32_PROGCTR(Context) ((Context).Eip) -#endif - -#if defined (_M_IA64) -#define PTW32_PROGCTR(Context) ((Context).StIIP) -#endif - -#if defined(_MIPS_) -#define PTW32_PROGCTR(Context) ((Context).Fir) -#endif - -#if defined(_ALPHA_) -#define PTW32_PROGCTR(Context) ((Context).Fir) -#endif - -#if defined(_PPC_) -#define PTW32_PROGCTR(Context) ((Context).Iar) -#endif - -#if defined(_AMD64_) -#define PTW32_PROGCTR(Context) ((Context).Rip) -#endif - -#if !defined(PTW32_PROGCTR) -#error Module contains CPU-specific code; modify and recompile. -#endif - -static void -ptw32_cancel_self (void) -{ - ptw32_throw (PTW32_EPS_CANCEL); - - /* Never reached */ -} - -static void CALLBACK -ptw32_cancel_callback (DWORD unused) -{ - ptw32_throw (PTW32_EPS_CANCEL); - - /* Never reached */ -} - -/* - * ptw32_RegisterCancelation() - - * Must have args of same type as QueueUserAPCEx because this function - * is a substitute for QueueUserAPCEx if it's not available. - */ -DWORD -ptw32_RegisterCancelation (PAPCFUNC unused1, HANDLE threadH, DWORD unused2) -{ - CONTEXT context; - - context.ContextFlags = CONTEXT_CONTROL; - GetThreadContext (threadH, &context); - PTW32_PROGCTR (context) = (DWORD_PTR) ptw32_cancel_self; - SetThreadContext (threadH, &context); - return 0; -} +#include "ptw32pch.h" int pthread_cancel (pthread_t thread) @@ -137,8 +75,8 @@ pthread_cancel (pthread_t thread) if ((self = pthread_self ()).p == NULL) { return ENOMEM; - }; - + } + /* * FIXME!! * @@ -149,14 +87,17 @@ pthread_cancel (pthread_t thread) * thread is itself. * * If it may, then we need to ensure that a thread can't - * deadlock itself trying to cancel itself asyncronously + * deadlock itself trying to cancel itself asynchronously * (pthread_cancel is required to be an async-cancel * safe function). */ cancel_self = pthread_equal (thread, self); - tp = (ptw32_thread_t *) thread.p; + // enables full cancel testing in pthread_testcancel, which is normally + // disabled because + _InterlockedIncrement( &ptw32_testcancel_enable ); + /* * Lock for async-cancel safety. */ @@ -178,24 +119,7 @@ pthread_cancel (pthread_t thread) } else { - HANDLE threadH = tp->threadH; - - SuspendThread (threadH); - - if (WaitForSingleObject (threadH, 0) == WAIT_TIMEOUT) - { - tp->state = PThreadStateCanceling; - tp->cancelState = PTHREAD_CANCEL_DISABLE; - /* - * If alertdrv and QueueUserAPCEx is available then the following - * will result in a call to QueueUserAPCEx with the args given, otherwise - * this will result in a call to ptw32_RegisterCancelation and only - * the threadH arg will be used. - */ - ptw32_register_cancelation (ptw32_cancel_callback, threadH, 0); - (void) pthread_mutex_unlock (&tp->cancelLock); - ResumeThread (threadH); - } + ptw32_PrepCancel( tp ); } } else diff --git a/3rdparty/w32pthreads/pthread_delay_np.c b/3rdparty/w32pthreads/pthread_delay_np.c index 7fe9ae0166..5d44caa262 100644 --- a/3rdparty/w32pthreads/pthread_delay_np.c +++ b/3rdparty/w32pthreads/pthread_delay_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * pthread_delay_np diff --git a/3rdparty/w32pthreads/pthread_detach.c b/3rdparty/w32pthreads/pthread_detach.c index 00fb6adfb6..a67c1bd0fb 100644 --- a/3rdparty/w32pthreads/pthread_detach.c +++ b/3rdparty/w32pthreads/pthread_detach.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * Not needed yet, but defining it should indicate clashes with build target diff --git a/3rdparty/w32pthreads/pthread_equal.c b/3rdparty/w32pthreads/pthread_equal.c index f96372edb8..410c4d5e7b 100644 --- a/3rdparty/w32pthreads/pthread_equal.c +++ b/3rdparty/w32pthreads/pthread_equal.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_exit.c b/3rdparty/w32pthreads/pthread_exit.c index 08d98dc835..7164a2ea7f 100644 --- a/3rdparty/w32pthreads/pthread_exit.c +++ b/3rdparty/w32pthreads/pthread_exit.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #ifndef _UWIN //# include #endif @@ -65,7 +64,13 @@ pthread_exit (void *value_ptr) * ------------------------------------------------------ */ { - ptw32_thread_t * sp = ptw32_selfThread; + ptw32_thread_t * sp; + + /* + * Don't use pthread_self() to avoid creating an implicit POSIX thread handle + * unnecessarily. + */ + sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); #ifdef _UWIN if (--pthread_count <= 0) diff --git a/3rdparty/w32pthreads/pthread_getconcurrency.c b/3rdparty/w32pthreads/pthread_getconcurrency.c index cf9e9c85c2..d1daac747c 100644 --- a/3rdparty/w32pthreads/pthread_getconcurrency.c +++ b/3rdparty/w32pthreads/pthread_getconcurrency.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_getschedparam.c b/3rdparty/w32pthreads/pthread_getschedparam.c index 0afcfb74a9..3c75d8b5ec 100644 --- a/3rdparty/w32pthreads/pthread_getschedparam.c +++ b/3rdparty/w32pthreads/pthread_getschedparam.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_getspecific.c b/3rdparty/w32pthreads/pthread_getspecific.c index b05ff410ac..1a69ec45e8 100644 --- a/3rdparty/w32pthreads/pthread_getspecific.c +++ b/3rdparty/w32pthreads/pthread_getspecific.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" void * diff --git a/3rdparty/w32pthreads/pthread_getw32threadhandle_np.c b/3rdparty/w32pthreads/pthread_getw32threadhandle_np.c index 9d22def3b4..dde49a8455 100644 --- a/3rdparty/w32pthreads/pthread_getw32threadhandle_np.c +++ b/3rdparty/w32pthreads/pthread_getw32threadhandle_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * pthread_getw32threadhandle_np() diff --git a/3rdparty/w32pthreads/pthread_join.c b/3rdparty/w32pthreads/pthread_join.c index 8237b6cf77..300e15e4f9 100644 --- a/3rdparty/w32pthreads/pthread_join.c +++ b/3rdparty/w32pthreads/pthread_join.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * Not needed yet, but defining it should indicate clashes with build target diff --git a/3rdparty/w32pthreads/pthread_key_create.c b/3rdparty/w32pthreads/pthread_key_create.c index 5e278c2ca7..fb55386da5 100644 --- a/3rdparty/w32pthreads/pthread_key_create.c +++ b/3rdparty/w32pthreads/pthread_key_create.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* TLS_OUT_OF_INDEXES not defined on WinCE */ @@ -98,7 +97,11 @@ pthread_key_create (pthread_key_t * key, void (*destructor) (void *)) * * The mutex will only be created when it is first locked. */ - newkey->keyLock = PTHREAD_MUTEX_INITIALIZER; + #ifdef PTW32_STATIC_MUTEXS + newkey->keyLock = PTHREAD_MUTEX_INITIALIZER; + #else + pthread_mutex_init (&newkey->keyLock, NULL); + #endif newkey->destructor = destructor; } diff --git a/3rdparty/w32pthreads/pthread_key_delete.c b/3rdparty/w32pthreads/pthread_key_delete.c index 7da9b2fb6d..032b9f50c9 100644 --- a/3rdparty/w32pthreads/pthread_key_delete.c +++ b/3rdparty/w32pthreads/pthread_key_delete.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_kill.c b/3rdparty/w32pthreads/pthread_kill.c index 7de3fe2aa7..e15129e869 100644 --- a/3rdparty/w32pthreads/pthread_kill.c +++ b/3rdparty/w32pthreads/pthread_kill.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * Not needed yet, but defining it should indicate clashes with build target diff --git a/3rdparty/w32pthreads/pthread_mutex_destroy.c b/3rdparty/w32pthreads/pthread_mutex_destroy.c index 95509b3df6..7bb0de6957 100644 --- a/3rdparty/w32pthreads/pthread_mutex_destroy.c +++ b/3rdparty/w32pthreads/pthread_mutex_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int @@ -51,7 +50,7 @@ pthread_mutex_destroy (pthread_mutex_t * mutex) /* * Check to see if we have something to delete. */ - if (*mutex < PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (!ptw32_static_mutex_enable || (*mutex < PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { mx = *mutex; @@ -120,7 +119,7 @@ pthread_mutex_destroy (pthread_mutex_t * mutex) /* * Check again. */ - if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (ptw32_static_mutex_enable && (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { /* * This is all we need to do to destroy a statically diff --git a/3rdparty/w32pthreads/pthread_mutex_init.c b/3rdparty/w32pthreads/pthread_mutex_init.c index 2f2cf92304..da16c6a3ed 100644 --- a/3rdparty/w32pthreads/pthread_mutex_init.c +++ b/3rdparty/w32pthreads/pthread_mutex_init.c @@ -34,9 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" int pthread_mutex_init (pthread_mutex_t * mutex, const pthread_mutexattr_t * attr) diff --git a/3rdparty/w32pthreads/pthread_mutex_lock.c b/3rdparty/w32pthreads/pthread_mutex_lock.c index 4ca5c252fe..526c597a99 100644 --- a/3rdparty/w32pthreads/pthread_mutex_lock.c +++ b/3rdparty/w32pthreads/pthread_mutex_lock.c @@ -34,13 +34,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ifndef _UWIN -//# include -#endif -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" -int +INLINE int pthread_mutex_lock (pthread_mutex_t * mutex) { int result = 0; @@ -60,7 +56,7 @@ pthread_mutex_lock (pthread_mutex_t * mutex) * again inside the guarded section of ptw32_mutex_check_need_init() * to avoid race conditions. */ - if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (ptw32_static_mutex_enable && (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { if ((result = ptw32_mutex_check_need_init (mutex)) != 0) { diff --git a/3rdparty/w32pthreads/pthread_mutex_timedlock.c b/3rdparty/w32pthreads/pthread_mutex_timedlock.c index a2385522d5..82283f732e 100644 --- a/3rdparty/w32pthreads/pthread_mutex_timedlock.c +++ b/3rdparty/w32pthreads/pthread_mutex_timedlock.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" static INLINE int @@ -122,7 +121,7 @@ pthread_mutex_timedlock (pthread_mutex_t * mutex, * again inside the guarded section of ptw32_mutex_check_need_init() * to avoid race conditions. */ - if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (ptw32_static_mutex_enable && (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { if ((result = ptw32_mutex_check_need_init (mutex)) != 0) { diff --git a/3rdparty/w32pthreads/pthread_mutex_trylock.c b/3rdparty/w32pthreads/pthread_mutex_trylock.c index 50e8bc65cc..81f79e219d 100644 --- a/3rdparty/w32pthreads/pthread_mutex_trylock.c +++ b/3rdparty/w32pthreads/pthread_mutex_trylock.c @@ -34,11 +34,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" -int +INLINE int pthread_mutex_trylock (pthread_mutex_t * mutex) { int result = 0; @@ -54,7 +53,7 @@ pthread_mutex_trylock (pthread_mutex_t * mutex) * again inside the guarded section of ptw32_mutex_check_need_init() * to avoid race conditions. */ - if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (ptw32_static_mutex_enable && (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { if ((result = ptw32_mutex_check_need_init (mutex)) != 0) { diff --git a/3rdparty/w32pthreads/pthread_mutex_unlock.c b/3rdparty/w32pthreads/pthread_mutex_unlock.c index 9ebe4e3781..706c429f02 100644 --- a/3rdparty/w32pthreads/pthread_mutex_unlock.c +++ b/3rdparty/w32pthreads/pthread_mutex_unlock.c @@ -34,11 +34,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" -int +INLINE int pthread_mutex_unlock (pthread_mutex_t * mutex) { int result = 0; @@ -55,7 +54,7 @@ pthread_mutex_unlock (pthread_mutex_t * mutex) * race condition. If another thread holds the * lock then we shouldn't be in here. */ - if (mx < PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) + if (!ptw32_static_mutex_enable || (mx < PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)) { if (mx->kind == PTHREAD_MUTEX_NORMAL) { diff --git a/3rdparty/w32pthreads/pthread_mutexattr_destroy.c b/3rdparty/w32pthreads/pthread_mutexattr_destroy.c index 9d424bfa28..e64a75eba5 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_destroy.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_mutexattr_getkind_np.c b/3rdparty/w32pthreads/pthread_mutexattr_getkind_np.c index 2d82ec6bc7..748b4ed560 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_getkind_np.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_getkind_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int pthread_mutexattr_getkind_np (pthread_mutexattr_t * attr, int *kind) diff --git a/3rdparty/w32pthreads/pthread_mutexattr_getpshared.c b/3rdparty/w32pthreads/pthread_mutexattr_getpshared.c index 42f9589c51..2b8d9f23b4 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_getpshared.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_getpshared.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_mutexattr_gettype.c b/3rdparty/w32pthreads/pthread_mutexattr_gettype.c index b60ca30bf0..3f6248f256 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_gettype.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_gettype.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_mutexattr_init.c b/3rdparty/w32pthreads/pthread_mutexattr_init.c index d2797ff248..2701a3d6c4 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_init.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_mutexattr_setkind_np.c b/3rdparty/w32pthreads/pthread_mutexattr_setkind_np.c index faa936658f..d82b9be354 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_setkind_np.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_setkind_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int pthread_mutexattr_setkind_np (pthread_mutexattr_t * attr, int kind) diff --git a/3rdparty/w32pthreads/pthread_mutexattr_setpshared.c b/3rdparty/w32pthreads/pthread_mutexattr_setpshared.c index cfa6f71994..1f7ab976fe 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_setpshared.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_setpshared.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_mutexattr_settype.c b/3rdparty/w32pthreads/pthread_mutexattr_settype.c index 8365daf65d..c55dd085a9 100644 --- a/3rdparty/w32pthreads/pthread_mutexattr_settype.c +++ b/3rdparty/w32pthreads/pthread_mutexattr_settype.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_num_processors_np.c b/3rdparty/w32pthreads/pthread_num_processors_np.c index 3067d117d3..eaeb3e978a 100644 --- a/3rdparty/w32pthreads/pthread_num_processors_np.c +++ b/3rdparty/w32pthreads/pthread_num_processors_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * pthread_num_processors_np() diff --git a/3rdparty/w32pthreads/pthread_once.c b/3rdparty/w32pthreads/pthread_once.c index 96d45f2974..8dccfb841f 100644 --- a/3rdparty/w32pthreads/pthread_once.c +++ b/3rdparty/w32pthreads/pthread_once.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" static void PTW32_CDECL diff --git a/3rdparty/w32pthreads/pthread_self.c b/3rdparty/w32pthreads/pthread_self.c index 57887dbb04..9f32429ede 100644 --- a/3rdparty/w32pthreads/pthread_self.c +++ b/3rdparty/w32pthreads/pthread_self.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" pthread_t pthread_self (void) @@ -61,7 +60,14 @@ pthread_self (void) { pthread_t self; pthread_t nil = {NULL, 0}; - ptw32_thread_t * sp = ptw32_selfThread; + ptw32_thread_t * sp; + +#ifdef _UWIN + if (!ptw32_selfThreadKey) + return nil; +#endif + + sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); if (sp != NULL) { @@ -121,7 +127,8 @@ pthread_self (void) * because the new handle is not yet public. */ sp->sched_priority = GetThreadPriority (sp->threadH); - ptw32_selfThread = ptw32_new().p; + + pthread_setspecific (ptw32_selfThreadKey, (void *) sp); } } diff --git a/3rdparty/w32pthreads/pthread_setcancelstate.c b/3rdparty/w32pthreads/pthread_setcancelstate.c index 002cfe5e42..ed8aa7f941 100644 --- a/3rdparty/w32pthreads/pthread_setcancelstate.c +++ b/3rdparty/w32pthreads/pthread_setcancelstate.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_setcanceltype.c b/3rdparty/w32pthreads/pthread_setcanceltype.c index 3fb3f0e49b..e47fa0304a 100644 --- a/3rdparty/w32pthreads/pthread_setcanceltype.c +++ b/3rdparty/w32pthreads/pthread_setcanceltype.c @@ -34,9 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" int pthread_setcanceltype (int type, int *oldtype) diff --git a/3rdparty/w32pthreads/pthread_setconcurrency.c b/3rdparty/w32pthreads/pthread_setconcurrency.c index f62346f8e5..40f8fd5f32 100644 --- a/3rdparty/w32pthreads/pthread_setconcurrency.c +++ b/3rdparty/w32pthreads/pthread_setconcurrency.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_setschedparam.c b/3rdparty/w32pthreads/pthread_setschedparam.c index a122eaca66..2f6f4c7598 100644 --- a/3rdparty/w32pthreads/pthread_setschedparam.c +++ b/3rdparty/w32pthreads/pthread_setschedparam.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/pthread_setspecific.c b/3rdparty/w32pthreads/pthread_setspecific.c index 00bce01fc1..4b3893c74a 100644 --- a/3rdparty/w32pthreads/pthread_setspecific.c +++ b/3rdparty/w32pthreads/pthread_setspecific.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int @@ -68,16 +67,40 @@ pthread_setspecific (pthread_key_t key, const void *value) pthread_t self; int result = 0; - /* - * Using pthread_self will implicitly create - * an instance of pthread_t for the current - * thread if one wasn't explicitly created - */ - self = pthread_self (); - if (self.p == NULL) - { - return ENOENT; - } + if (key != ptw32_selfThreadKey) + { + /* + * Using pthread_self will implicitly create + * an instance of pthread_t for the current + * thread if one wasn't explicitly created + */ + self = pthread_self (); + if (self.p == NULL) + { + return ENOENT; + } + } + else + { + /* + * Resolve catch-22 of registering thread with selfThread + * key + */ + ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); + + if (sp == NULL) + { + if (value == NULL) + { + return ENOENT; + } + self = *((pthread_t *) value); + } + else + { + self = sp->ptHandle; + } + } result = 0; diff --git a/3rdparty/w32pthreads/pthread_spin_destroy.c b/3rdparty/w32pthreads/pthread_spin_destroy.c index 8fe22674da..1e9fbd8ff8 100644 --- a/3rdparty/w32pthreads/pthread_spin_destroy.c +++ b/3rdparty/w32pthreads/pthread_spin_destroy.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_spin_init.c b/3rdparty/w32pthreads/pthread_spin_init.c index b9467b83e6..7368720016 100644 --- a/3rdparty/w32pthreads/pthread_spin_init.c +++ b/3rdparty/w32pthreads/pthread_spin_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_spin_lock.c b/3rdparty/w32pthreads/pthread_spin_lock.c index 90b3abee47..f4b569adef 100644 --- a/3rdparty/w32pthreads/pthread_spin_lock.c +++ b/3rdparty/w32pthreads/pthread_spin_lock.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_spin_trylock.c b/3rdparty/w32pthreads/pthread_spin_trylock.c index c601a191fe..2eef61d967 100644 --- a/3rdparty/w32pthreads/pthread_spin_trylock.c +++ b/3rdparty/w32pthreads/pthread_spin_trylock.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_spin_unlock.c b/3rdparty/w32pthreads/pthread_spin_unlock.c index 67bc2c218d..249ad0d2f1 100644 --- a/3rdparty/w32pthreads/pthread_spin_unlock.c +++ b/3rdparty/w32pthreads/pthread_spin_unlock.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/pthread_testcancel.c b/3rdparty/w32pthreads/pthread_testcancel.c index ad7cdb9944..1270eeb167 100644 --- a/3rdparty/w32pthreads/pthread_testcancel.c +++ b/3rdparty/w32pthreads/pthread_testcancel.c @@ -34,11 +34,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" - -void +INLINE void pthread_testcancel (void) /* * ------------------------------------------------------ @@ -68,8 +66,14 @@ pthread_testcancel (void) * ------------------------------------------------------ */ { - pthread_t self = pthread_self (); - ptw32_thread_t * sp = (ptw32_thread_t *) self.p; + ptw32_thread_t * sp; + if( ptw32_testcancel_enable == 0 ) return; + + // Don't use pthread_self here, to avoid unnecessary object query or creation. + // If ptw32_selfThread is NULL, then it's a sure bet no one's tried to cancel + // this thread, since that would have spawned a selfThread object! -- air + + sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); if (sp == NULL) { @@ -86,6 +90,8 @@ pthread_testcancel (void) return; } + _InterlockedDecrement( &ptw32_testcancel_enable ); + (void) pthread_mutex_lock (&sp->cancelLock); if (sp->cancelState != PTHREAD_CANCEL_DISABLE) diff --git a/3rdparty/w32pthreads/pthread_timechange_handler_np.c b/3rdparty/w32pthreads/pthread_timechange_handler_np.c index 7d8170a3ff..45afdf00aa 100644 --- a/3rdparty/w32pthreads/pthread_timechange_handler_np.c +++ b/3rdparty/w32pthreads/pthread_timechange_handler_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * Notes on handling system time adjustments (especially negative ones). diff --git a/3rdparty/w32pthreads/pthread_win32_attach_detach_np.c b/3rdparty/w32pthreads/pthread_win32_attach_detach_np.c index 627f103302..9cea0925c3 100644 --- a/3rdparty/w32pthreads/pthread_win32_attach_detach_np.c +++ b/3rdparty/w32pthreads/pthread_win32_attach_detach_np.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * Handle to kernel32.dll @@ -51,8 +50,6 @@ BOOL pthread_win32_process_attach_np () { BOOL result = TRUE; - DWORD_PTR vProcessCPUs; - DWORD_PTR vSystemCPUs; if( ptw32_processInitialized ) return TRUE; @@ -65,92 +62,6 @@ pthread_win32_process_attach_np () ptw32_features = 0; -#if defined(NEED_PROCESS_AFFINITY_MASK) - - ptw32_smp_system = PTW32_FALSE; - -#else - - if (GetProcessAffinityMask (GetCurrentProcess (), - &vProcessCPUs, &vSystemCPUs)) - { - int CPUs = 0; - DWORD_PTR bit; - - for (bit = 1; bit != 0; bit <<= 1) - { - if (vSystemCPUs & bit) - { - CPUs++; - } - } - ptw32_smp_system = (CPUs > 1); - } - else - { - ptw32_smp_system = PTW32_FALSE; - } - -#endif - -#if 0 - -#ifdef WINCE - - /* - * Load COREDLL and try to get address of InterlockedCompareExchange - */ - ptw32_h_kernel32 = LoadLibrary (TEXT ("COREDLL.DLL")); - -#else - - /* - * Load KERNEL32 and try to get address of InterlockedCompareExchange - */ - ptw32_h_kernel32 = LoadLibrary (TEXT ("KERNEL32.DLL")); - -#endif - -// We're only using pthreads' inline version of InterlockedExchange - ptw32_interlocked_compare_exchange = - (PTW32_INTERLOCKED_LONG (WINAPI *) - (PTW32_INTERLOCKED_LPLONG, PTW32_INTERLOCKED_LONG, - PTW32_INTERLOCKED_LONG)) -#if defined(NEED_UNICODE_CONSTS) - GetProcAddress (ptw32_h_kernel32, - (const TCHAR *) TEXT ("InterlockedCompareExchange")); -#else - GetProcAddress (ptw32_h_kernel32, (LPCSTR) "InterlockedCompareExchange"); -#endif - - if (ptw32_interlocked_compare_exchange == NULL) - { - ptw32_interlocked_compare_exchange = ptw32_InterlockedCompareExchange; - - /* - * If InterlockedCompareExchange is not being used, then free - * the kernel32.dll handle now, rather than leaving it until - * DLL_PROCESS_DETACH. - * - * Note: this is not a pedantic exercise in freeing unused - * resources! It is a work-around for a bug in Windows 95 - * (see microsoft knowledge base article, Q187684) which - * does Bad Things when FreeLibrary is called within - * the DLL_PROCESS_DETACH code, in certain situations. - * Since w95 just happens to be a platform which does not - * provide InterlockedCompareExchange, the bug will be - * effortlessly avoided. - */ - (void) FreeLibrary (ptw32_h_kernel32); - ptw32_h_kernel32 = 0; - } - else - { - ptw32_features |= PTW32_SYSTEM_INTERLOCKED_COMPARE_EXCHANGE; - } - -#endif - /* * Load QUSEREX.DLL and try to get address of QueueUserAPCEx */ @@ -213,7 +124,7 @@ pthread_win32_process_detach_np () { if (ptw32_processInitialized) { - ptw32_thread_t * sp = ptw32_selfThread; + ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); if (sp != NULL) { @@ -224,8 +135,7 @@ pthread_win32_process_detach_np () if (sp->detachState == PTHREAD_CREATE_DETACHED) { ptw32_threadDestroy (sp->ptHandle); - free(ptw32_selfThread); - ptw32_selfThread = NULL; + TlsSetValue (ptw32_selfThreadKey->key, NULL); } } @@ -278,7 +188,7 @@ pthread_win32_thread_detach_np () * Don't use pthread_self() - to avoid creating an implicit POSIX thread handle * unnecessarily. */ - ptw32_thread_t * sp = ptw32_selfThread; + ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); if (sp != NULL) // otherwise Win32 thread with no implicit POSIX handle. { @@ -295,8 +205,8 @@ pthread_win32_thread_detach_np () if (sp->detachState == PTHREAD_CREATE_DETACHED) { ptw32_threadDestroy (sp->ptHandle); - free(ptw32_selfThread); - ptw32_selfThread = NULL; + + TlsSetValue (ptw32_selfThreadKey->key, NULL); } } } diff --git a/3rdparty/w32pthreads/pthreads_2008.vcproj b/3rdparty/w32pthreads/pthreads_2008.vcproj index d7efd24dd0..261f46c065 100644 --- a/3rdparty/w32pthreads/pthreads_2008.vcproj +++ b/3rdparty/w32pthreads/pthreads_2008.vcproj @@ -2,7 +2,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -745,1849 +285,236 @@ RelativePath=".\ptw32pch.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2753,538 +948,6 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3313,622 +976,6 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - threadH; + + SuspendThread (threadH); + + if (WaitForSingleObject (threadH, 0) == WAIT_TIMEOUT) + { + tp->state = PThreadStateCanceling; + tp->cancelState = PTHREAD_CANCEL_DISABLE; + /* + * If alertdrv and QueueUserAPCEx is available then the following + * will result in a call to QueueUserAPCEx with the args given, otherwise + * this will result in a call to ptw32_RegisterCancelation and only + * the threadH arg will be used. + */ + ptw32_register_cancelation (ptw32_cancel_callback, threadH, 0); + (void) pthread_mutex_unlock (&tp->cancelLock); + ResumeThread (threadH); + } +} \ No newline at end of file diff --git a/3rdparty/w32pthreads/ptw32_cond_check_need_init.c b/3rdparty/w32pthreads/ptw32_cond_check_need_init.c index 31359ad3fd..f256227bab 100644 --- a/3rdparty/w32pthreads/ptw32_cond_check_need_init.c +++ b/3rdparty/w32pthreads/ptw32_cond_check_need_init.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" INLINE int diff --git a/3rdparty/w32pthreads/ptw32_getprocessors.c b/3rdparty/w32pthreads/ptw32_getprocessors.c index e60c3143f9..8b27c9ab81 100644 --- a/3rdparty/w32pthreads/ptw32_getprocessors.c +++ b/3rdparty/w32pthreads/ptw32_getprocessors.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* diff --git a/3rdparty/w32pthreads/ptw32_is_attr.c b/3rdparty/w32pthreads/ptw32_is_attr.c index 36395f81f0..93b54ded37 100644 --- a/3rdparty/w32pthreads/ptw32_is_attr.c +++ b/3rdparty/w32pthreads/ptw32_is_attr.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int ptw32_is_attr (const pthread_attr_t * attr) diff --git a/3rdparty/w32pthreads/ptw32_mutex_check_need_init.c b/3rdparty/w32pthreads/ptw32_mutex_check_need_init.c index 35ec366bde..2752f856af 100644 --- a/3rdparty/w32pthreads/ptw32_mutex_check_need_init.c +++ b/3rdparty/w32pthreads/ptw32_mutex_check_need_init.c @@ -34,8 +34,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" +#include static struct pthread_mutexattr_t_ ptw32_recursive_mutexattr_s = {PTHREAD_PROCESS_PRIVATE, PTHREAD_MUTEX_RECURSIVE}; @@ -51,6 +51,9 @@ ptw32_mutex_check_need_init (pthread_mutex_t * mutex) register int result = 0; register pthread_mutex_t mtx; + // Make sure static mutexes are enabled. + assert( ptw32_static_mutex_enable ); + /* * The following guarded test is specifically for statically * initialised mutexes (via PTHREAD_MUTEX_INITIALIZER). @@ -72,6 +75,7 @@ ptw32_mutex_check_need_init (pthread_mutex_t * mutex) * the number of processors + 1. * */ + EnterCriticalSection (&ptw32_mutex_test_init_lock); /* diff --git a/3rdparty/w32pthreads/ptw32_new.c b/3rdparty/w32pthreads/ptw32_new.c index 281256741b..2a28aa80dd 100644 --- a/3rdparty/w32pthreads/ptw32_new.c +++ b/3rdparty/w32pthreads/ptw32_new.c @@ -34,9 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" pthread_t ptw32_new (void) @@ -74,8 +72,15 @@ ptw32_new (void) tp->detachState = PTHREAD_CREATE_JOINABLE; tp->cancelState = PTHREAD_CANCEL_ENABLE; tp->cancelType = PTHREAD_CANCEL_DEFERRED; + + #ifdef PTW32_STATIC_MUTEXS tp->cancelLock = PTHREAD_MUTEX_INITIALIZER; tp->threadLock = PTHREAD_MUTEX_INITIALIZER; + #else + pthread_mutex_init (&tp->cancelLock, NULL); + pthread_mutex_init (&tp->threadLock, NULL); + #endif + tp->cancelEvent = CreateEvent (0, (int) PTW32_TRUE, /* manualReset */ (int) PTW32_FALSE, /* setSignaled */ NULL); diff --git a/3rdparty/w32pthreads/ptw32_processInitialize.c b/3rdparty/w32pthreads/ptw32_processInitialize.c index bdd9ca9791..452965e037 100644 --- a/3rdparty/w32pthreads/ptw32_processInitialize.c +++ b/3rdparty/w32pthreads/ptw32_processInitialize.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int @@ -80,8 +79,10 @@ ptw32_processInitialize (void) /* * Initialize Keys */ - if (pthread_key_create (&ptw32_cleanupKey, NULL) != 0) + if ((pthread_key_create (&ptw32_selfThreadKey, NULL) != 0) || + (pthread_key_create (&ptw32_cleanupKey, NULL) != 0)) { + ptw32_processTerminate (); } diff --git a/3rdparty/w32pthreads/ptw32_processTerminate.c b/3rdparty/w32pthreads/ptw32_processTerminate.c index 5400714976..b0bcb14e7b 100644 --- a/3rdparty/w32pthreads/ptw32_processTerminate.c +++ b/3rdparty/w32pthreads/ptw32_processTerminate.c @@ -35,9 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" void ptw32_processTerminate (void) @@ -66,9 +64,23 @@ ptw32_processTerminate (void) { ptw32_thread_t * tp, * tpNext; + if (ptw32_selfThreadKey != NULL) + { + /* + * Release ptw32_selfThreadKey + */ + pthread_key_delete (ptw32_selfThreadKey); + + ptw32_selfThreadKey = NULL; + } + if (ptw32_cleanupKey != NULL) { + /* + * Release ptw32_cleanupKey + */ pthread_key_delete (ptw32_cleanupKey); + ptw32_cleanupKey = NULL; } diff --git a/3rdparty/w32pthreads/ptw32_relmillisecs.c b/3rdparty/w32pthreads/ptw32_relmillisecs.c index 01db362313..a3e94282c4 100644 --- a/3rdparty/w32pthreads/ptw32_relmillisecs.c +++ b/3rdparty/w32pthreads/ptw32_relmillisecs.c @@ -34,11 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ifndef _UWIN -//#include -#endif -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #ifndef NEED_FTIME #include #endif diff --git a/3rdparty/w32pthreads/ptw32_reuse.c b/3rdparty/w32pthreads/ptw32_reuse.c index 0e86984967..740271419b 100644 --- a/3rdparty/w32pthreads/ptw32_reuse.c +++ b/3rdparty/w32pthreads/ptw32_reuse.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* diff --git a/3rdparty/w32pthreads/ptw32_rwlock_cancelwrwait.c b/3rdparty/w32pthreads/ptw32_rwlock_cancelwrwait.c index a057bd1d72..7e009aae33 100644 --- a/3rdparty/w32pthreads/ptw32_rwlock_cancelwrwait.c +++ b/3rdparty/w32pthreads/ptw32_rwlock_cancelwrwait.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" void ptw32_rwlock_cancelwrwait (void *arg) diff --git a/3rdparty/w32pthreads/ptw32_rwlock_check_need_init.c b/3rdparty/w32pthreads/ptw32_rwlock_check_need_init.c index ea2561eefb..63683711f9 100644 --- a/3rdparty/w32pthreads/ptw32_rwlock_check_need_init.c +++ b/3rdparty/w32pthreads/ptw32_rwlock_check_need_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" INLINE int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock) diff --git a/3rdparty/w32pthreads/ptw32_semwait.c b/3rdparty/w32pthreads/ptw32_semwait.c index 8b23d11d62..b2771e34a0 100644 --- a/3rdparty/w32pthreads/ptw32_semwait.c +++ b/3rdparty/w32pthreads/ptw32_semwait.c @@ -34,11 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ifndef _UWIN -//# include -#endif -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" int diff --git a/3rdparty/w32pthreads/ptw32_spinlock_check_need_init.c b/3rdparty/w32pthreads/ptw32_spinlock_check_need_init.c index bf45bc397a..4532459fe5 100644 --- a/3rdparty/w32pthreads/ptw32_spinlock_check_need_init.c +++ b/3rdparty/w32pthreads/ptw32_spinlock_check_need_init.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" INLINE int diff --git a/3rdparty/w32pthreads/ptw32_threadDestroy.c b/3rdparty/w32pthreads/ptw32_threadDestroy.c index eb9abfc61c..7543853de6 100644 --- a/3rdparty/w32pthreads/ptw32_threadDestroy.c +++ b/3rdparty/w32pthreads/ptw32_threadDestroy.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" void diff --git a/3rdparty/w32pthreads/ptw32_threadStart.c b/3rdparty/w32pthreads/ptw32_threadStart.c index 028ba768a6..0569fea3f8 100644 --- a/3rdparty/w32pthreads/ptw32_threadStart.c +++ b/3rdparty/w32pthreads/ptw32_threadStart.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #ifdef __CLEANUP_SEH @@ -165,7 +164,7 @@ ptw32_threadStart (void *vthreadParms) } #endif - ptw32_selfThread = sp; + pthread_setspecific (ptw32_selfThreadKey, sp); sp->state = PThreadStateRunning; diff --git a/3rdparty/w32pthreads/ptw32_throw.c b/3rdparty/w32pthreads/ptw32_throw.c index c54a7c0a1c..8349cab8af 100644 --- a/3rdparty/w32pthreads/ptw32_throw.c +++ b/3rdparty/w32pthreads/ptw32_throw.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" /* * ptw32_throw @@ -53,7 +52,7 @@ ptw32_throw (DWORD exception) * Don't use pthread_self() to avoid creating an implicit POSIX thread handle * unnecessarily. */ - ptw32_thread_t * sp = ptw32_selfThread; + ptw32_thread_t * sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); #ifdef __CLEANUP_SEH DWORD exceptionInformation[3]; @@ -81,7 +80,7 @@ ptw32_throw (DWORD exception) exitCode = (unsigned) PTHREAD_CANCELED; break; case PTW32_EPS_EXIT: - exitCode = (unsigned) sp->exitStatus; + exitCode = (unsigned) sp->exitStatus;; break; } diff --git a/3rdparty/w32pthreads/ptw32_timespec.c b/3rdparty/w32pthreads/ptw32_timespec.c index 6a2cb565a7..adf5aa9bc9 100644 --- a/3rdparty/w32pthreads/ptw32_timespec.c +++ b/3rdparty/w32pthreads/ptw32_timespec.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #ifdef NEED_FTIME diff --git a/3rdparty/w32pthreads/ptw32_tkAssocCreate.c b/3rdparty/w32pthreads/ptw32_tkAssocCreate.c index 5ba24bbf71..d3f543567f 100644 --- a/3rdparty/w32pthreads/ptw32_tkAssocCreate.c +++ b/3rdparty/w32pthreads/ptw32_tkAssocCreate.c @@ -35,9 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" - +#include "ptw32pch.h" int ptw32_tkAssocCreate (ptw32_thread_t * sp, pthread_key_t key) diff --git a/3rdparty/w32pthreads/ptw32_tkAssocDestroy.c b/3rdparty/w32pthreads/ptw32_tkAssocDestroy.c index a7842ea87d..5620c3c1e5 100644 --- a/3rdparty/w32pthreads/ptw32_tkAssocDestroy.c +++ b/3rdparty/w32pthreads/ptw32_tkAssocDestroy.c @@ -35,8 +35,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" void diff --git a/3rdparty/w32pthreads/resource.h b/3rdparty/w32pthreads/resource.h index fa3ad73e2d..eeb767f049 100644 --- a/3rdparty/w32pthreads/resource.h +++ b/3rdparty/w32pthreads/resource.h @@ -1,6 +1,7 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by w32pthreads.v2.rc +// Used by w32pthreads.rc +// // Next default values for new objects // diff --git a/3rdparty/w32pthreads/rwlock.c b/3rdparty/w32pthreads/rwlock.c deleted file mode 100644 index a019bbc138..0000000000 --- a/3rdparty/w32pthreads/rwlock.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * rwlock.c - * - * Description: - * This translation unit implements read/write lock primitives. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#include "ptw32_rwlock_check_need_init.c" -#include "ptw32_rwlock_cancelwrwait.c" -#include "pthread_rwlock_init.c" -#include "pthread_rwlock_destroy.c" -#include "pthread_rwlockattr_init.c" -#include "pthread_rwlockattr_destroy.c" -#include "pthread_rwlockattr_getpshared.c" -#include "pthread_rwlockattr_setpshared.c" -#include "pthread_rwlock_rdlock.c" -#include "pthread_rwlock_timedrdlock.c" -#include "pthread_rwlock_wrlock.c" -#include "pthread_rwlock_timedwrlock.c" -#include "pthread_rwlock_unlock.c" -#include "pthread_rwlock_tryrdlock.c" -#include "pthread_rwlock_trywrlock.c" diff --git a/3rdparty/w32pthreads/sched.c b/3rdparty/w32pthreads/sched.c deleted file mode 100644 index 9b779c35ab..0000000000 --- a/3rdparty/w32pthreads/sched.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * sched.c - * - * Description: - * POSIX thread functions that deal with thread scheduling. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" -#include "sched.h" - -#include "pthread_attr_setschedpolicy.c" -#include "pthread_attr_getschedpolicy.c" -#include "pthread_attr_setschedparam.c" -#include "pthread_attr_getschedparam.c" -#include "pthread_attr_setinheritsched.c" -#include "pthread_attr_getinheritsched.c" -#include "pthread_setschedparam.c" -#include "pthread_getschedparam.c" -#include "sched_get_priority_max.c" -#include "sched_get_priority_min.c" -#include "sched_setscheduler.c" -#include "sched_getscheduler.c" -#include "sched_yield.c" diff --git a/3rdparty/w32pthreads/sched_get_priority_max.c b/3rdparty/w32pthreads/sched_get_priority_max.c index cabf2320a7..1e9f7fa2e7 100644 --- a/3rdparty/w32pthreads/sched_get_priority_max.c +++ b/3rdparty/w32pthreads/sched_get_priority_max.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" /* diff --git a/3rdparty/w32pthreads/sched_get_priority_min.c b/3rdparty/w32pthreads/sched_get_priority_min.c index 9c4f8591e5..f82c899f4b 100644 --- a/3rdparty/w32pthreads/sched_get_priority_min.c +++ b/3rdparty/w32pthreads/sched_get_priority_min.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" /* diff --git a/3rdparty/w32pthreads/sched_getscheduler.c b/3rdparty/w32pthreads/sched_getscheduler.c index 9bc819e476..43042505d0 100644 --- a/3rdparty/w32pthreads/sched_getscheduler.c +++ b/3rdparty/w32pthreads/sched_getscheduler.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/sched_setscheduler.c b/3rdparty/w32pthreads/sched_setscheduler.c index 4e060c7e55..05e4bbb71e 100644 --- a/3rdparty/w32pthreads/sched_setscheduler.c +++ b/3rdparty/w32pthreads/sched_setscheduler.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/sched_yield.c b/3rdparty/w32pthreads/sched_yield.c index 6ac5ed9263..58e58de11a 100644 --- a/3rdparty/w32pthreads/sched_yield.c +++ b/3rdparty/w32pthreads/sched_yield.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" #include "sched.h" int diff --git a/3rdparty/w32pthreads/sem_close.c b/3rdparty/w32pthreads/sem_close.c index 2f95c87857..48b3856334 100644 --- a/3rdparty/w32pthreads/sem_close.c +++ b/3rdparty/w32pthreads/sem_close.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/sem_destroy.c b/3rdparty/w32pthreads/sem_destroy.c index 6c98e80b93..8e0ce34b96 100644 --- a/3rdparty/w32pthreads/sem_destroy.c +++ b/3rdparty/w32pthreads/sem_destroy.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" int diff --git a/3rdparty/w32pthreads/sem_getvalue.c b/3rdparty/w32pthreads/sem_getvalue.c index baafb02cf0..032e60e0af 100644 --- a/3rdparty/w32pthreads/sem_getvalue.c +++ b/3rdparty/w32pthreads/sem_getvalue.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" int diff --git a/3rdparty/w32pthreads/sem_init.c b/3rdparty/w32pthreads/sem_init.c index 02acd90f11..a9b089574b 100644 --- a/3rdparty/w32pthreads/sem_init.c +++ b/3rdparty/w32pthreads/sem_init.c @@ -39,9 +39,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" int sem_init (sem_t * sem, int pshared, unsigned int value) diff --git a/3rdparty/w32pthreads/sem_open.c b/3rdparty/w32pthreads/sem_open.c index bf48c831ca..64b1595465 100644 --- a/3rdparty/w32pthreads/sem_open.c +++ b/3rdparty/w32pthreads/sem_open.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/sem_post.c b/3rdparty/w32pthreads/sem_post.c index c7a7a3cf90..017363e0fc 100644 --- a/3rdparty/w32pthreads/sem_post.c +++ b/3rdparty/w32pthreads/sem_post.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" int diff --git a/3rdparty/w32pthreads/sem_post_multiple.c b/3rdparty/w32pthreads/sem_post_multiple.c index 3d1e4ef286..6dd23a4d36 100644 --- a/3rdparty/w32pthreads/sem_post_multiple.c +++ b/3rdparty/w32pthreads/sem_post_multiple.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" int diff --git a/3rdparty/w32pthreads/sem_timedwait.c b/3rdparty/w32pthreads/sem_timedwait.c index 52146b478e..195167827f 100644 --- a/3rdparty/w32pthreads/sem_timedwait.c +++ b/3rdparty/w32pthreads/sem_timedwait.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" typedef struct { diff --git a/3rdparty/w32pthreads/sem_trywait.c b/3rdparty/w32pthreads/sem_trywait.c index 63614ba2b8..7751b274ec 100644 --- a/3rdparty/w32pthreads/sem_trywait.c +++ b/3rdparty/w32pthreads/sem_trywait.c @@ -41,12 +41,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" -int +INLINE int sem_trywait (sem_t * sem) /* * ------------------------------------------------------ diff --git a/3rdparty/w32pthreads/sem_unlink.c b/3rdparty/w32pthreads/sem_unlink.c index a6c6f81b0f..809ea46cfc 100644 --- a/3rdparty/w32pthreads/sem_unlink.c +++ b/3rdparty/w32pthreads/sem_unlink.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" /* ignore warning "unreferenced formal parameter" */ #ifdef _MSC_VER diff --git a/3rdparty/w32pthreads/sem_wait.c b/3rdparty/w32pthreads/sem_wait.c index d39d2b4b65..a485205195 100644 --- a/3rdparty/w32pthreads/sem_wait.c +++ b/3rdparty/w32pthreads/sem_wait.c @@ -41,9 +41,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" +#include "ptw32pch.h" #include "semaphore.h" -#include "implement.h" static void PTW32_CDECL @@ -79,7 +78,7 @@ ptw32_sem_wait_cleanup(void * sem) } } -int +INLINE int sem_wait (sem_t * sem) /* * ------------------------------------------------------ diff --git a/3rdparty/w32pthreads/semaphore.c b/3rdparty/w32pthreads/semaphore.c deleted file mode 100644 index edc9b01d1c..0000000000 --- a/3rdparty/w32pthreads/semaphore.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * ------------------------------------------------------------- - * - * Module: semaphore.c - * - * Purpose: - * Concatenated version of separate modules to allow - * inlining optimisation, which it is assumed can only - * be effective within a single module. - * - * Semaphores aren't actually part of the PThreads standard. - * They are defined by the POSIX Standard: - * - * POSIX 1003.1b-1993 (POSIX.1b) - * - * ------------------------------------------------------------- - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - -#ifndef NEED_FTIME -# include -#endif - -#include - -#include "semaphore.h" - - -#include "sem_init.c" -#include "sem_destroy.c" -#include "sem_trywait.c" -#include "sem_wait.c" -#include "sem_timedwait.c" -#include "sem_post.c" -#include "sem_post_multiple.c" -#include "sem_getvalue.c" -#include "sem_open.c" -#include "sem_close.c" -#include "sem_unlink.c" diff --git a/3rdparty/w32pthreads/spin.c b/3rdparty/w32pthreads/spin.c deleted file mode 100644 index c0a6c5b33f..0000000000 --- a/3rdparty/w32pthreads/spin.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * spin.c - * - * Description: - * This translation unit implements spin lock primitives. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - - -#include "ptw32_spinlock_check_need_init.c" -#include "pthread_spin_init.c" -#include "pthread_spin_destroy.c" -#include "pthread_spin_lock.c" -#include "pthread_spin_unlock.c" -#include "pthread_spin_trylock.c" diff --git a/3rdparty/w32pthreads/sync.c b/3rdparty/w32pthreads/sync.c deleted file mode 100644 index 25c97c06db..0000000000 --- a/3rdparty/w32pthreads/sync.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * sync.c - * - * Description: - * This translation unit implements functions related to thread - * synchronisation. - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - - -#include "pthread_detach.c" -#include "pthread_join.c" diff --git a/3rdparty/w32pthreads/tsd.c b/3rdparty/w32pthreads/tsd.c deleted file mode 100644 index 9a9b3b882b..0000000000 --- a/3rdparty/w32pthreads/tsd.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * tsd.c - * - * Description: - * POSIX thread functions which implement thread-specific data (TSD). - * - * -------------------------------------------------------------------------- - * - * 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 "ptw32pch.h" - - -#include "pthread_key_create.c" -#include "pthread_key_delete.c" -#include "pthread_setspecific.c" -#include "pthread_getspecific.c" diff --git a/3rdparty/w32pthreads/w32_CancelableWait.c b/3rdparty/w32pthreads/w32_CancelableWait.c index 97e15aa310..44507c9215 100644 --- a/3rdparty/w32pthreads/w32_CancelableWait.c +++ b/3rdparty/w32pthreads/w32_CancelableWait.c @@ -34,8 +34,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "pthread.h" -#include "implement.h" +#include "ptw32pch.h" static INLINE int diff --git a/3rdparty/w32pthreads/w32pthreads.rc b/3rdparty/w32pthreads/w32pthreads.rc index bd048f1815..a0379ff273 100644 --- a/3rdparty/w32pthreads/w32pthreads.rc +++ b/3rdparty/w32pthreads/w32pthreads.rc @@ -7,8 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxresmw.h" - +#include "afxresmw.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -51,7 +50,7 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,8,2,0 + FILEVERSION 2,8,3,0 PRODUCTVERSION 2,8,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG @@ -69,10 +68,10 @@ BEGIN BEGIN VALUE "Comments", "Built for PCSX2 (SEH, CDECL, Align16)" VALUE "FileDescription", "POSIX Threads for Win32" - VALUE "FileVersion", "2.8.pxr2" + VALUE "FileVersion", "2.8.pxr3" VALUE "InternalName", "w32pthreads" VALUE "LegalCopyright", "Copyright (C) 2009" - VALUE "OriginalFilename", "w32pthreads.v2" + VALUE "OriginalFilename", "w32pthreads.v3" VALUE "ProductName", "w32pthreads" VALUE "ProductVersion", "2.8" END @@ -93,8 +92,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - - + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/common/vsprops/pthreads.vsprops b/common/vsprops/pthreads.vsprops index f86662b6b8..29c645d6c2 100644 --- a/common/vsprops/pthreads.vsprops +++ b/common/vsprops/pthreads.vsprops @@ -8,9 +8,10 @@ Name="VCCLCompilerTool" AdditionalIncludeDirectories=""$(SvnRootDir)\3rdparty\w32pthreads\include"" PreprocessorDefinitions="WIN32_PTHREADS;__CLEANUP_SEH" + ExceptionHandling="2" /> diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index 243ffb49b3..dd55b4d87f 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -452,6 +452,7 @@ namespace Panels protected: StatusPanel& m_StatusPanel; ComboBoxPanel& m_ComponentBoxes; + bool m_Canceled; wxScopedPtr m_FileList; // list of potential plugin files wxScopedPtr m_EnumeratorThread; diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 84bee4ac74..64aa8cc08e 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -558,6 +558,7 @@ sptr Panels::PluginSelectorPanel::EnumThread::ExecuteTask() for( int curidx=0; curidx < m_master.FileCount(); ++curidx ) { DoNextPlugin( curidx ); + if( (curidx & 3) == 3 ) wxGetApp().Ping(); // gives the gui thread some time to refresh pthread_testcancel(); } diff --git a/pcsx2_suite_2008.sln b/pcsx2_suite_2008.sln index a073580361..94a4413d3a 100644 --- a/pcsx2_suite_2008.sln +++ b/pcsx2_suite_2008.sln @@ -10,6 +10,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcsx2", "pcsx2\windows\VCpr {26511268-2902-4997-8421-ECD7055F9E28} = {26511268-2902-4997-8421-ECD7055F9E28} {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86} = {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86} {A51123F5-9505-4EAE-85E7-D320290A272C} = {A51123F5-9505-4EAE-85E7-D320290A272C} EndProjectSection EndProject @@ -129,6 +130,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "3rdparty\libjpeg EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glew_static", "3rdparty\glew\glew_static_vs2008.vcproj", "{067D7863-393B-494F-B296-4A8853EB3D1D}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w32pthreads_lib", "3rdparty\w32pthreads\pthreads_lib_2008.vcproj", "{7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}" + ProjectSection(ProjectDependencies) = postProject + {26511268-2902-4997-8421-ECD7055F9E28} = {26511268-2902-4997-8421-ECD7055F9E28} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -506,8 +512,8 @@ Global {BC236261-77E8-4567-8D09-45CD02965EB6}.Debug|Win32.ActiveCfg = Debug|Win32 {BC236261-77E8-4567-8D09-45CD02965EB6}.Debug|Win32.Build.0 = Debug|Win32 {BC236261-77E8-4567-8D09-45CD02965EB6}.Debug|x64.ActiveCfg = Debug|Win32 - {BC236261-77E8-4567-8D09-45CD02965EB6}.Devel|Win32.ActiveCfg = Debug|Win32 - {BC236261-77E8-4567-8D09-45CD02965EB6}.Devel|Win32.Build.0 = Debug|Win32 + {BC236261-77E8-4567-8D09-45CD02965EB6}.Devel|Win32.ActiveCfg = Release|Win32 + {BC236261-77E8-4567-8D09-45CD02965EB6}.Devel|Win32.Build.0 = Release|Win32 {BC236261-77E8-4567-8D09-45CD02965EB6}.Devel|x64.ActiveCfg = Debug|Win32 {BC236261-77E8-4567-8D09-45CD02965EB6}.Release SSE2|Win32.ActiveCfg = Release|Win32 {BC236261-77E8-4567-8D09-45CD02965EB6}.Release SSE2|Win32.Build.0 = Release|Win32 @@ -533,6 +539,21 @@ Global {067D7863-393B-494F-B296-4A8853EB3D1D}.Release SSSE3|Win32.ActiveCfg = Release|Win32 {067D7863-393B-494F-B296-4A8853EB3D1D}.Release SSSE3|Win32.Build.0 = Release|Win32 {067D7863-393B-494F-B296-4A8853EB3D1D}.Release SSSE3|x64.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Debug|Win32.ActiveCfg = Debug|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Debug|Win32.Build.0 = Debug|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Debug|x64.ActiveCfg = Debug|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Devel|Win32.ActiveCfg = Devel|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Devel|Win32.Build.0 = Devel|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Devel|x64.ActiveCfg = Devel|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE2|Win32.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE2|Win32.Build.0 = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE2|x64.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE4|Win32.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE4|Win32.Build.0 = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSE4|x64.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSSE3|Win32.ActiveCfg = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSSE3|Win32.Build.0 = Release|Win32 + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86}.Release SSSE3|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -557,6 +578,7 @@ Global {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {BC236261-77E8-4567-8D09-45CD02965EB6} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {067D7863-393B-494F-B296-4A8853EB3D1D} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} + {7E9B2BE7-CEC3-4F14-847B-0AB8D562FB86} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {BF7B81A5-E348-4F7C-A69F-F74C8EEEAD70} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E} {3D0EB14D-32F3-4D82-9C6D-B806ADBB859C} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E} {04439C5F-05FB-4A9C-AAD1-5388C25377DB} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E}