Permalink
Browse files

Some cleanups, mostly x86_64 compat plus interlocked macros

  • Loading branch information...
rpj
rpj committed Mar 3, 2011
1 parent 5b18428 commit ae637485691f92f4faca542c810c3a779d3f7f8d
Showing with 467 additions and 253 deletions.
  1. +32 −3 ChangeLog
  2. +3 −3 Makefile
  3. +16 −1 NEWS
  4. +8 −0 config.h
  5. +1 −1 context.h
  6. +0 −11 global.c
  7. +219 −16 implement.h
  8. +3 −0 pthread.h
  9. +1 −1 pthread_barrier_wait.c
  10. +1 −1 pthread_cancel.c
  11. +1 −1 pthread_delay_np.c
  12. +1 −1 pthread_exit.c
  13. +1 −1 pthread_once.c
  14. +2 −2 pthread_spin_destroy.c
  15. +1 −1 pthread_timechange_handler_np.c
  16. +0 −64 pthread_win32_attach_detach_np.c
  17. +8 −4 ptw32_InterlockedCompareExchange.c
  18. +22 −15 ptw32_MCS_lock.c
  19. +6 −3 ptw32_relmillisecs.c
  20. +2 −2 ptw32_threadStart.c
  21. +2 −2 ptw32_throw.c
  22. +1 −3 tests/Bmakefile
  23. +10 −0 tests/ChangeLog
  24. +1 −2 tests/GNUmakefile
  25. +4 −6 tests/Makefile
  26. +21 −20 tests/SIZES.VC
  27. +21 −19 tests/SIZES.VCE
  28. +14 −13 tests/benchtest1.c
  29. +4 −4 tests/benchtest2.c
  30. +4 −4 tests/benchtest3.c
  31. +4 −4 tests/benchtest4.c
  32. +8 −8 tests/benchtest5.c
  33. +1 −1 tests/condvar2.c
  34. +1 −1 tests/condvar2_1.c
  35. +1 −1 tests/condvar3.c
  36. +1 −1 tests/condvar3_1.c
  37. +2 −2 tests/condvar3_2.c
  38. +1 −1 tests/condvar3_3.c
  39. +2 −2 tests/condvar4.c
  40. +2 −2 tests/condvar5.c
  41. +1 −1 tests/condvar6.c
  42. +1 −1 tests/condvar7.c
  43. +1 −1 tests/condvar8.c
  44. +1 −1 tests/condvar9.c
  45. +1 −1 tests/mutex8.c
  46. +1 −1 tests/mutex8e.c
  47. +1 −1 tests/mutex8n.c
  48. +1 −1 tests/mutex8r.c
  49. +1 −1 tests/rwlock2_t.c
  50. +1 −1 tests/rwlock3_t.c
  51. +1 −1 tests/rwlock4_t.c
  52. +1 −1 tests/rwlock5_t.c
  53. +1 −1 tests/rwlock6_t.c
  54. +1 −1 tests/rwlock6_t2.c
  55. +4 −4 tests/rwlock7.c
  56. +4 −4 tests/rwlock8.c
  57. +3 −3 tests/spin4.c
  58. +1 −1 tests/stress1.c
  59. +8 −0 tests/test.h
View
@@ -1,8 +1,37 @@
+2011-03-04 Ross Johnson <ross.johnson at homemail.com.au>
+
+ * implement.h (PTW32_INTERLOCKED_*): Mingw32 does not provide
+ the __sync_* intrinsics so implemented them here as macro
+ assembler routines. MSVS Interlocked* are emmitted as intrinsics
+ wherever possible, so we want mingw to match it; Extended to
+ include all interlocked routines used by the library; implemented
+ x86_64 versions also.
+ * ptw32_InterlockedCompareExchange.c: No code remaining here.
+ * ptw32_MCS_lock.c: Converted interlocked calls to use new macros.
+ * pthread_barrier_wait.c: Likewise.
+ * pthread_once.c: Likewise.
+
+2011-02-28 Ross Johnson <ross.johnson at homemail.com.au>
+
+ * ptw32_relmillisecs.c: If possible, use _ftime64_s or _ftime64
+ before resorting to _ftime.
+
2011-02-27 Ross Johnson <ross.johnson at homemail.com.au>
- * sched_setscheduler: Ensure the handle is closed after use.
- * sched_getscheduler: Likewise.
- * pthread.h: Remove POSIX compatibility macros.
+ * sched_setscheduler.c: Ensure the handle is closed after use.
+ * sched_getscheduler.c: Likewise.
+ * pthread.h: Remove POSIX compatibility macros; don't define
+ timespec if already defined.
+ * context.h: Changes for 64 bit.
+ * pthread_cancel.c: Likewise.
+ * pthread_exit.c: Likewise.
+ * pthread_spin_destroy.c: Likewise.
+ * pthread_timechange_handler_np.c: Likewise.
+ * ptw32_MCS_lock.c: Likewise; some of these changes may
+ not be compatible with pre Windows 2000 systems; reverse the order of
+ the includes.
+ * ptw32_threadStart.c: Likewise.
+ * ptw32_throw.c: Likewise.
2011-02-13 Ross Johnson <ross.johnson at homemail.com.au>
View
@@ -28,7 +28,7 @@ OPTIM = /O2 /Ob2
OPTIMD =
CFLAGS = /W3 /MD /nologo /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
-CFLAGSD = /Zi $(CFLAGS)
+CFLAGSD = /Z7 $(CFLAGS)
# Uncomment this if config.h defines RETAIN_WSALASTERROR
#XLIBS = wsock32.lib
@@ -37,8 +37,8 @@ CFLAGSD = /Zi $(CFLAGS)
CLEANUP = __CLEANUP_C
# C++ Exceptions
-VCEFLAGS = /GX /TP $(CFLAGS)
-VCEFLAGSD = /GX /TP $(CFLAGSD)
+VCEFLAGS = /EHsc /TP $(CFLAGS)
+VCEFLAGSD = /EHsc /TP $(CFLAGSD)
#Structured Exceptions
VSEFLAGS = $(CFLAGS)
VSEFLAGSD = $(CFLAGSD)
View
17 NEWS
@@ -1,13 +1,17 @@
CURRENT CVS HEAD Version
RELEASE 2.9.0 pending
-------------
-(2010-??-??)
+(2011-??-??)
General
-------
New bug fixes in this release since 2.8.0 have NOT been applied to the
1.x.x series.
+Version 2.8.0 may be the last release for some older Windows systems.
+Some changes post 2011-02-26 in CVS may not be compatible with pre
+Windows 2000 systems.
+
Version 1 no longer maintained
------------------------------
The 1.x.x series is no longer maintained. However, if you really need a
@@ -47,6 +51,9 @@ See README.NONPORTABLE for descriptions of these routines.
Bug fixes
---------
+Many more changes for 64 bit systems.
+- Kai Tietz
+
Various modifications and fixes to build and test for WinCE.
- Marcel Ruff, Sinan Kaya
@@ -75,6 +82,14 @@ have slowed barriers down slightly but halves the number of semaphores
consumed per barrier to one.
- Ross Johnson
+Fixed a handle leak in sched_[gs]etscheduler.
+- Mark Pizzolato
+
+Removed all of the POSIX re-entrant function compatibility macros from pthread.h.
+Some were simply not semanticly correct.
+- Igor Lubashev
+
+
RELEASE 2.8.0
-------------
(2006-12-22)
View
@@ -46,6 +46,14 @@
/* Do we know about type mode_t? */
#undef HAVE_MODE_T
+/*
+ * Define if GCC has atomic builtins, i.e. __sync_* intrinsics
+ * __sync_lock_* is implemented in mingw32 gcc 4.5.2 at least
+ * so this define does not turn those on or off. If you get an
+ * error from __sync_lock* then consider upgrading your gcc.
+ */
+#undef HAVE_GCC_ATOMIC_BUILTINS
+
/* Define if you have the timespec struct */
#undef HAVE_STRUCT_TIMESPEC
View
@@ -39,7 +39,7 @@
#undef PTW32_PROGCTR
-#if defined(_M_IX86) || defined(_X86_)
+#if defined(_M_IX86) || (defined(_X86_) && !defined(__amd64__))
#define PTW32_PROGCTR(Context) ((Context).Eip)
#endif
View
@@ -54,17 +54,6 @@ int ptw32_features = 0;
BOOL ptw32_smp_system = PTW32_TRUE; /* Safer if assumed true initially. */
-/*
- * Function pointer to InterlockedCompareExchange if it exists, otherwise
- * it will be set at runtime to a substitute local version with the same
- * functionality but may be architecture specific.
- */
-PTW32_INTERLOCKED_LONG
- (WINAPI * ptw32_interlocked_compare_exchange) (PTW32_INTERLOCKED_LPLONG,
- PTW32_INTERLOCKED_LONG,
- PTW32_INTERLOCKED_LONG) =
- NULL;
-
/*
* Function pointer to QueueUserAPCEx if it exists, otherwise
* it will be set at runtime to a substitute routine which cannot unblock
Oops, something went wrong.

0 comments on commit ae63748

Please sign in to comment.