-
Notifications
You must be signed in to change notification settings - Fork 25
/
ChangeLog
5586 lines (4166 loc) · 211 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2013-12-09 Ross Johnson <ross dot johnson at homemail dot com dot au>
* Makefile (.rc.res): Add logic to extract target CPU from different
environments.
2013-07-23 Keith Clanton <keith dot clanton at cloudcar dot com>
* create.c: Don't apply cpu affinity from thread attributes for WINCE;
bug fix.
2013-07-23 Ross Johnson <ross dot johnson at homemail dot com dot au>
* config.h (HAVE_CPU_AFFINITY): Defined.
* several (WINCE): Substitute HAVE_CPU_AFFINITY where appropriate.
2013-07-17 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_getname_np.c: Replace strncpy_s with strncpy to support older
MSVCRT.DLLs.
* pthread_attr_getname_np.c: Likewise.
2013-06-19 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_attr_init.c: Initialise thread name element.
* create.c: Initialise thread name from attributes.
2013-06-13 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_setname_np.c: Initial version.
* pthread_getname_np.c: Initial version.
* pthread_attr_setname_np.c: Initial version.
* pthread_attr_getname_np.c: Initial version.
* pthread.h: Add new prototypes.
* implement.h (pthread_attr_t_): Add "thrname" element.
* (ptw32_thread_t): Add "name" element.
2013-06-06 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread.h (_POSIX_THREAD_ATTR_STACKADDR): Now set to -1. The API
prototypes are defined but return ENOSYS; previously the addr value was
stored in the attribute struct and retreivable but unused.
* pthread_attr_setstackaddr.c: Should return ENOSYS rather than silently
ignore the setting.
* pthread_attr_getstackaddr.c: Likewise.
* pthread_attr_getaffinity_np.c: Initial version.
* pthread_attr_setaffinity_np.c: Initial version.
2013-05-01 Andrew Chernow <achernow at gmail dot com>
* dll.c: Add invocation of thread detach logic for static linked
applications for MSVC8.0 or later builds.
2012-12-19 Jason Baker <jason underscore baker at symantec dot com>
* pthread_win32_attach_detach_np.c (pthread_win32_process_attach_np):
Fix function calls involving TCHAR.
2012-10-29 Ross Johnson <ross dot johnson at homemail dot com dot au>
* sem_destroy.c: Remove NULL argument checks. These are only useful
to guard against some uninitialised arguments, not an invalid sem_t.
* sem_wait.c: Likewise.
* sem_post.c: Likewise.
* sem_post_multiple.c: Likewise.
* sem_timedwait.c: Likewise.
* sem_trywait.c: Likewise.
* ptw32_semwait.c: Likewise.
2012-10-28 Ross Johnson <ross dot johnson at homemail dot com dot au>
* implement.h: sem_t_ replace internal state mutex with MCS lock.
* sem_init.c: Rewrite to use MCS lock rather than mutex.
* sem_destroy.c: Likewise.
* sem_wait.c: Likewise.
* sem_post.c: Likewise.
* sem_post_multiple.c: Likewise.
* sem_timedwait.c: Likewise.
* sem_trywait.c: Likewise.
* ptw32_semwait.c: Likewise.
2012-10-26 sicaf-- at hanmail dot net
* error.c: For WinCE use a more specific cast.
* implement.h: For WinCE don't include process.h.
* pthread_win32_attach_detach_np.c: For WinCE don't restrict QUserEx.dll
search to system path.
2012-10-24 Stephane Clairet <Stephane dot Clairet at 4d dot com>
* pthread_key_delete.c: Bug fix - move keylock release to after the
while loop. (This bug first was introduced at release 2.9.1)
2012-10-16 Ross Johnson <ross dot johnson at homemail dot com dot au>
* Makefile: Remove SDK environment setting; now needs to be done
explicitly before running any nmake.
* GNUmakefile: Move per command-line ARCH setting to TESTS_ENV.
2012-10-04 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_tryjoin_np.c: New API
* pthread.c (pthread_try_join_np): Added.
* common.mk (pthread_tryjoin_np): Added.
* pthread.h (pthread_tryjoin_np): Added.
* NEWS: Updated.
* README: Updated.
* ANNOUNCE: Updated.
2012-10-02 Ross Johnson <ross dot johnson at homemail dot com dot au>
* sched.h (cpu_set_t): Redefined.
* implement.h (_sched_cpu_set_vector_): Created as the private equivalent
of cpu_set.
(pthread_thread_t_.cpuset): Type change.
* sched_setaffinity.c: Reflect changes to cpu_set_t and _sched_cpu_set_vector_.
* pthread_setaffinity.c: Likewise.
* create.c: Likewise.
* pthread_self.c: Likewise.
* ptw32_new.c: Likewise.
2012-09-28 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread.c: pulls all individual source modules into a single
translation unit.
* common.mk: Remove everything related to the non-inlined dll targets.
This removes all the intermediate .c files that #include other .c files
except for pthread.c.
* Makefile: Remove and rename targets; remove or edit variables. All
of this is to remove the intermediate translation unit aggregation
source files.
* GNUmakefile: Likewise.
* attr.c: Removed.
* barrier.c: Removed.
* cancel.c: Removed.
* condvar.c: Removed.
* exit.c: Removed.
* fork.c: Removed.
* misc.c: Removed.
* mutex.c: Removed.
* nonportable.c: Removed.
* private.c: Removed.
* rwlock.c: Removed.
* sched.c: Removed.
* spin.c: Removed.
* sync.c: Removed.
* tsd.c: Removed.
2012-09-28 Ross Johnson <ross dot johnson at homemail dot com dot au>
* Makefile: expand on rudimentary install target; add DEST_LIB_NAME
variable defaulting to "pthread.lib".
* GNUmakefile: Add install target similar to Makefile with DEST_LIB_NAME
defaulting to "libpthread.a".
2012-09-28 Daniel Richard. G <danielg at teragram dot com>
* all: #include<config.h>; renamed HAVE_PTW32_CONFIG_H define in
build files to HAVE_CONFIG_H since we no longer need a
uniquely-named symbol for this.
* Bmakefile: Removed _WIN32_WINNT assignment from build files since
this is now handled in source.
* Wmakefile: Likewise.
* Makefile: Added mkdir invocations to "install" target.
* common.mk: Elaborated the pthread.$(OBJEXT) dependency list.
* pthread.h: Removed the #include"config.h" bit.
2012-09-23 Ross Johnson <ross dot johnson at homemail dot com dot au>
* GNUmakefile: Modify "all-tests" to use new targets in tests
GNUmakefile.
* Makefile: Similarly.
2012-09-22 Daniel Richard. G <danielg at teragram dot com>
* GNUmakefile: Reordered the command lines in the "help" target
to match the ordering of the targets in the makefile, which IMO
is nicer to the eye; tweaked some of the parentheticals for better
clarity; delete *.manifest files, in case the user just finished
doing an MSVC build.
* Makefile: Use *.static_stamp for the static targets instead of
*.static; added a note re VC++6 and /EHs vs. /EHa; reordered the
targets, and added a number of new ones (e.g. VSE-small-static);
added a note recommending *-inlined and *-small-static to make
things a little easier for users bewildered by the large number of
targets; reworked the all-tests[-cflags] targets so that (1) more
useful targets are built first (the small-static targets make it
easier to track down compilation errors), (2) *-debug build and
test targets can be used, (3) less-useful build/test permutations
are enabled only if EXHAUSTIVE and/or MORE_EXHAUSTIVE is defined,
and (4) /MDd and /MTd are covered too; "nmake all-tests-cflags
EXHAUSTIVE=1 MORE_EXHAUSTIVE=1" takes a few hours to run; moved
some of the VCE targets up, since the pattern in the file was
already to list VCE targets first, then VSE, then VC; actually
touch the stamp file in the stamp targets.
* README.NONPORTABLE: It's "DllMain", not "dllMain".
* common.mk: Start of an attempt to define dependencies for
pthread.$(OBJEXT).
* implement.h: Generalized PTW32_BROKEN_ERRNO into
PTW32_USES_SEPARATE_CRT; don't do the autostatic-anchoring thing
if we're not building the library!
* pthread.h: Moved the PTW32_CDECL bit into sched.h. pthread.h
already #includes sched.h, so the latter is a good place to put
definitions that need to be shared in common; severely simplified
the errno declaration for Open Watcom, made it applicable only to
Open Watcom, and made the comment less ambiguous; updated the long
comment describing PTW32_BROK^WPTW32_USES_SEPARATE_CRT; added
(conditional) declaration of pthread_win32_set_terminate_np(), as
well as ptw32_terminate_handler (so that eh.h doesn't have to get
involved).
* pthread_cond_wait.c: Missed a couple of errno conversions.
* pthread_mutex_consistent.c: Visual Studio (either 2010 or 2008
Express, don't recall now) actually errored out due to charset
issues in this file, so I've replaced non-ASCII characters with
ASCII approximations.
* ptw32_threadStart.c: Big rewrite of ptw32_threadStart().
Everything passes with this, except for GCE (and I can't figure
out why).
* sched.h: Moved the PTW32_CDECL section here (and made it
idempotent); need to #include <stdlib.h> for size_t (one of the test
programs #includes sched.h as the very first thing); moved the
DWORD_PTR definition up, since it groups better with the pid_t
definition; also need ULONG_PTR, don't need PDWORD_PTR; can't use
PTW32_CONFIG_MSVC6, because if you only #include sched.h you
don't get that bit in pthread.h; use a cpp symbol
(PTW32_HAVE_DWORD_PTR) to inhibit defining *_PTR if needed. Note
that this isn't #defined inside the conditional, because there are
no other instances of these typedefs that need to be disabled, and
sched.h itself is already protected against multiple inclusion;
DWORD_PTR can't be size_t, because (on MSVC6) the former is "unsigned
long" and the latter is "unsigned int" and C++ doesn't see them as
interchangeable; minor edit to the comment... I don't like saying
"VC++" without the "Microsoft" qualifier; use PTW32_CDECL instead of
a literal __cdecl (this was why I moved the PTW32_CDECL bit into this
file).
* semaphore.h: Put in another idempotentized PTW32_CDECL bit here;
use PTW32_CDECL instead of __cdecl, and fixed indentation of function
formal parameters.
2012-09-21 Ross Johnson <ross dot johnson at homemail dot com dot au>
* create.c: Major changes to incorporate CPU affinity inheritance.
* pthread_self.c: Likewise.
* ptw32_new.c (cpuset): Initialise new pthread_thread_t element.
* pthread.h (DWORD_PTR): Conditional definition moved to sched.h.
* sched.h (DWORD_PTR): As above; other changes.
* sem_post.c: Fix errno handling and restructure.
* sem_getvalue.c: Fix return value and restructure.
2012-09-18 Ross Johnson <ross dot johnson at homemail dot com dot au>
* sched_setaffinity.c: New API to set process CPU affinity in POSIX
context; compatibility with Linux.
* pthread_setaffinity.c: Likewise.
* implement.h (pthread_t_): Added cpuset element.
* sched.h: Added new prototypes.
* sched.h (cpu_set_t): Support for new process and thread affinity API.
* pthread.h: Added new prototypes.
2012-09-16 Ross Johnson <ross dot johnson at homemail dot com dot au>
* README (Version numbering): Changes back to major.minor.micro.
* README.NONPORTABLE: Updated description around process/thread
attach/detach routines.
2012-09-05 Daniel Richard. G <danielg at teragram dot com>
* implement.h: whitespace adjustment.
* dll.c: Facilitate PTW32_STATIC_LIB being defined in a header file.
2012-09-04 Ross Johnson <ross dot johnson at homemail dot com dot au>
* Makefile (VCEFLAGS): Changed from /EHsc to /EHs which fixed a problem
in tests/once3.c which was causing it to hang.
2012-09-03 Ross Johnson <ross dot johnson at homemail dot com dot au>
* Makefile: Remove descriptive info from help target, just list the
available targets. Output tends to be poorly formatted and cluttered
otherwise.
(VCE-static): Add VC++ static build target.
(VCE-small-static): Likewise.
(VCE-small-static-debug): Likewise.
(VCE-small-static-debug): Likewise.
2012-09-02 Ross Johnson <ross dot johnson at homemail dot com dot au>
* All: correct spelling to 'cancellation'.
2012-08-31 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_attr_getschedpolicy.c: Remove pedantic arg check.
* pthread_getschedparam.c: Likewise.
* pthread_mutex_timelock.c: Restructure to address unreached final
return statement.
2012-08-31 Daniel Richard. G <danielg at teragram dot com>
* implement.h (INLINE): only define if building the inlined make targets. G++
complained about undefined reference to ptw32_robust_mutex_remove() because it
appears in separate compilation units for "make GCE".
2012-08-29 Ross Johnson <ross dot johnson at homemail dot com dot au>
* ptw32_MCS_lock.c (ptw32_mcs_flag_wait): Fix cast in first 'if' statement.
* pthread_mutex_consistent.c (comment): Fix awkward grammar.
* pthread_mutexattr_init.c: Initialize robustness element.
2012-08-29 Daniel Richard. G <danielg at teragram dot com>
* implement.h (PTW32_INTERLOCKED_SIZE): Define as long or LONGLONG.
(PTW32_INTERLOCKED_SIZEPTR): Define as long* or LONGLONG*.
* pthread_attr_getschedpolicy.c (SCHED_MAX): Fix cast.
* ptw32_mutex_check_need_init.c: Fix static mutexattr_t struct initializations.
* ptw32_threadStart.c (ExceptionFilter): Add cast.
* ptw32_throw.c: Add cast.
2012-08-18 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_timedjoin_np.c: New non-portable function.
* common.mk (pthread_timedjoin_np): Add new function.
* nonportable.c (pthread_timedjoin_np): Likewise.
2012-08-16 Daniel Richard. G <danielg at teragram dot com>
* pthread.h (PTW32_CONFIG_MINGW): Defined to simplify complex macro combination.
* (PTW32_CONFIG_MSVC6): Likewise.
* (PTW32_CONFIG_MSVC8): Likewise.
* autostatic.c: Substitute new macros.
* create.c: Likewise.
* pthread_cond_wait.c: Likewise.
* pthread_exit.c: Likewise.
* pthread_once.c: Likewise.
* pthread_rwlock_timedwrlock.c: Likewise.
* pthread_rwlock_wrlock.c: Likewise.
* pthread_win32_attach_detach_np.c: Likewise.
* ptw32_relmillisecs.c: Likewise.
* ptw32_threadDestroy.c: Likewise.
* ptw32_threadStart.c: Likewise.
* ptw32_throw.c: Likewise.
* sem_timedwait.c: Likewise.
* sem_wait.c: Likewise.
* implement.h: Likewise.
* sched.h: Likewise.
2012-08-11 Ross Johnson <ross dot johnson at homemail dot com dot au>
* common.mk (default_target): restore previous behaviour of outputing
useful help when "make" is run without a target argument.
2012-08-11 Daniel Richard. G <danielg at teragram dot com>
* autostatic.c (ptw32_autostatic_anchor): new function; other
changes aimed at de-abstracting functionality.
* impliment.h (ptw32_autostatic_anchor): dummy reference to
ensure that autostatic.o is always linked into static applications.
* GNUmakefile: Various improvements.
* Makefile: Likewise.
2012-03-19 Ross Johnson <ross dot johnson at homemail dot com dot au>
* implement.h: Fix interlocked pointer casting under VC++ x64.
2012-03-19 Ross Johnson <ross dot johnson at homemail dot com dot au>
* implement.h (ptw32_spinlock_check_need_init): added missing
forward declaration.
2012-07-19 Daniel Richard. G <danielg at teragram dot com>
* common.mk: New; macros common to all build environment makefiles.
* Bmakefile: Include new common.mk
* Makefile: Likewise; various fixes; added normal and small objects
static build.
* GNUmakefile: Likewise.
2012-03-18 Ross Johnson <ross dot johnson at homemail dot com dot au>
* create.c (pthread_create): add __cdecl attribute to thread routine
arg
* implement.h (pthread_key_t): add __cdecl attribute to destructor
element
(ThreadParms): likewise for start element
* pthread.h (pthread_create): add __cdecl to prototype start arg
(pthread_once): likewise for init_routine arg
(pthread_key_create): likewise for destructor arg
(ptw32_cleanup_push): replace type of routine arg with previously
defined ptw32_cleanup_callback_t
* pthread_key_create.c: add __cdecl attribute to destructor arg
* pthread_once.c: add __cdecl attribute to init_routine arg
* ptw32_threadStart.c (start): add __cdecl to start variable type
2011-07-06 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_cond_wait.c (pragma inline_depth): this is almost redundant
now nevertheless fixed thei controlling MSC_VER from "< 800" to
"< 1400" (i.e. any prior to VC++ 8.0).
* pthread_once.ci (pragma inline_depth): Likewise.
* pthread_rwlock_timedwrlock.ci (pragma inline_depth): Likewise.
* pthread_rwlock_wrlock.ci (pragma inline_depth): Likewise.
* sem_timedwait.ci (pragma inline_depth): Likewise.
* sem_wait.ci (pragma inline_depth): Likewise.
2011-07-05 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_win32_attach_detach_np.c: Use strncat_s if available
to removei a compile warning; MingW supports this routine but we
continue to use strncat anyway there because it is secure if
given the correct parameters; fix strncat param 3 to avoid
buffer overrun exploitation potential.
2011-07-03 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_spin_unlock.c (EPERM): Return success if unlocking a lock
that is not locked, because single CPU machines wrap a
PTHREAD_MUTEX_NORMAL mutex, which returns success in this case.
* pthread_win32_attach_detach_np.c (QUSEREX.DLL): Load from an
absolute path only which must be the Windows System folder.
2011-07-03 Daniel Richard G. <skunk at iskunk dot org>
* Makefile (_WIN32_WINNT): Removed; duplicate definition in
implement.h; more cleanup and enhancements.
2011-07-02 Daniel Richard G. <skunk at iskunk dot org>
* Makefile: Cleanups and implovements.
* ptw32_MCS_locks.c: Casting fixes.
* implement.h: Interlocked call and argument casting macro fixes
to support older and newer build environments.
2011-07-01 Ross Johnson <ross dot johnson at homemail dot com dot au>
* *.[ch] (PTW32_INTERLOCKED_*): Redo 23 and 64 bit versions of these
macros and re-apply in code to undo the incorrect changes from
2011-06-29; remove some size_t casts which should not be required
and may be problematic.a
There are now two sets of macros:
PTW32_INTERLOCKED_*_LONG which work only on 32 bit integer variables;
PTW32_INTERLOCKED_*_SIZE which work on size_t integer variables, i.e.
LONG for 32 bit systems and LONGLONG for 64 bit systems.
* implement.h (MCS locks): nextFlag and waitFlag are now HANDLE type.
* ptw32_MCS_locks.c: Likewise.
* pthread.h (#include <setjmp.h>): Removed.
* ptw32_throw.c (#include <setjmp.h>): Added.
* ptw32_threadStart.c (#include <setjmp.h>): Added.
* implement.h (#include <setjmp.h>): Added.
2011-06-30 Ross Johnson <ross dot johnson at homemail dot com dot au>
* pthread_once.c: Tighten 'if' statement casting; fix interlocked
pointer cast for 64 bit compatibility (missed yesterday); remove
the superfluous static cleanup routine and call the release routine
directly if popped.
* create.c (stackSize): Now type size_t.
* pthread.h (struct ptw32_thread_t_): Rearrange to fix element alignments.
2011-06-29 Daniel Richard G. <skunk at iskunk dot org>
* ptw32_relmillisecs.c (ftime):
_ftime64_s() is only available in MSVC 2005 or later;
_ftime64() is available in MinGW or MSVC 2002 or later;
_ftime() is always available.
* pthread.h (long long): Not defined in older MSVC 6.
* implement.h (long long): Likewise.
* pthread_getunique_np.c (long long): Likewise.
2011-06-29 Ross Johnson <ross dot johnson at homemail dot com dot au>
* *.[ch] (PTW32_INTERLOCKED_*): These macros should now work for
both 32 and 64 bit builds. The MingW versions are all inlined asm
while the MSVC versions expand to their Interlocked* or Interlocked*64
counterparts appropriately. The argument type have also been changed
to cast to the appropriate value or pointer size for the architecture.
2011-05-29 Ross Johnson <ross dot johnson at homemail dot com dot au>
* *.[ch] (#ifdef): Extended cleanup to whole project.
2011-05-29 Daniel Richard G. <skunk at iskunk dot org>
* Makefile (CC): Define CC to allow use of other compatible
compilers such as the Intel compilter icl.
* implement.h (#if): Fix forms like #if HAVE_SOMETHING.
* pthread.h: Likewise.
* sched.h: Likewise; PTW32_LEVEL_* becomes PTW32_SCHED_LEVEL_*.
* semaphore.h: Likewise.
2011-05-11 Ross Johnson <ross.johnson at homemail.com.au>
* ptw32_callUserDestroyRoutines.c (terminate): Altered includes
to match ptw32_threadStart.c.
* GNUmakefile (GCE-inlined-debug, DOPT): Fixed.
2011-04-31 Ross Johnson <ross.johnson at homemail.com.au>
* (robust mutexes): Added this API. The API is not
mandatory for implementations that don't support PROCESS_SHARED
mutexes, nevertheless it was considered useful both functionally
and for source-level compatibility.
2011-03-26 Ross Johnson <ross.johnson at homemail.com.au>
* pthread_getunique_np.c: New non-POSIX interface for compatibility
with some other implementations; returns a 64 bit sequence number
that is unique to each thread in the process.
* pthread.h (pthread_getunique_np): Added.
* global.c: Add global sequence counter for above.
* implement.h: Likewise.
2011-03-25 Ross Johnson <ross.johnson at homemail.com.au>
* (cancelLock): Convert to an MCS lock and rename to stateLock.
* (threadLock): Likewise.
* (keyLock): Likewise.
* pthread_mutex*.c: First working robust mutexes.
2011-03-11 Ross Johnson <ross.johnson at homemail.com.au>
* implement.h (PTW32_INTERLOCKED_*CREMENT macros): increment/decrement
using ++/-- instead of add/subtract 1.
* ptw32_MCS_lock.c: Make casts consistent.
2011-03-09 Ross Johnson <ross.johnson at homemail.com.au>
* implement.h (ptw32_thread_t_): Add process unique sequence number.
* global.c: Replace global Critical Section objects with MCS
queue locks.
* implement.h: Likewise.
* pthread_cond_destroy.c: Likewise.
* pthread_cond_init.c: Likewise.
* pthread_detach.c: Likewise.
* pthread_join.c: Likewise.
* pthread_kill.c: Likewise.
* pthread_mutex_destroy.c: Likewise.
* pthread_rwlock_destroy.c: Likewise.
* pthread_spin_destroy.c: Likewise.
* pthread_timechange_handler_np.c: Likewise.
* ptw32_cond_check_need_init.c: Likewise.
* ptw32_mutex_check_need_init.c: Likewise.
* ptw32_processInitialize.c: Likewise.
* ptw32_processTerminate.c: Likewise.
* ptw32_reuse.c: Likewise.
* ptw32_rwlock_check_need_init.c: Likewise.
* ptw32_spinlock_check_need_init.c: Likewise.
2011-03-06 Ross Johnson <ross.johnson at homemail.com.au>
* several (MINGW64): Cast and call fixups for 64 bit compatibility;
clean build via x86_64-w64-mingw32 cross toolchain on Linux i686
targeting x86_64 win64.
* ptw32_threadStart.c (ptw32_threadStart): Routine no longer attempts
to pass [unexpected C++] exceptions out of scope but ends the thread
normally setting EINTR as the exit status.
* ptw32_throw.c: Fix C++ exception throwing warnings; ignore
informational warning.
* implement.h: Likewise with the corresponding header definition.
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.
* ptw32_MCS_lock.c (ptw32_mcs_node_substitute): Name changed to
ptw32_mcs_node_transfer.
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.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>
* pthread_self: Add comment re returning 'nil' value to
indicate failure only to win32 threads that call us.
* pthread_attr_setstackaddr: Fix comments; note this
function and it's compliment are now removed from SUSv4.
2011-02-12 Ross Johnson <ross.johnson at homemail.com.au>
README.NONPORTABLE: Record a description of an obvious
method for nulling/comparing/hashing pthread_t using a
union; plus and investigation of a change of type for
pthread_t (to a union) to neutralise any padding bits and
bytes if they occur in pthread_t (the current pthread_t struct
does not contain padding AFAIK, but porting the library to a
future architecture may introduce them). Padding affects
byte-by-byte copies and compare operations.
2010-11-16 Ross Johnson <ross.johnson at homemail.com.au>
* ChangeLog: Add this entry ;-)
Restore entries from 2007 through 2009 that went missing
at the last update.
2010-06-19 Ross Johnson <ross.johnson at homemail.com.au>
* ptw32_MCS_lock.c (ptw32_mcs_node_substitute): Fix variable
names to avoid using C++ keyword ("new").
* implement.h (ptw32_mcs_node_substitute): Likewise.
* pthread_barrier_wait.c: Fix signed/unsigned comparison warning.
2010-06-18 Ramiro Polla <ramiro.polla at gmail.com >
* autostatic.c: New file; call pthread_win32_process_*()
libary init/cleanup routines automatically on application start
when statically linked.
* pthread.c (autostatic.c): Included.
* pthread.h (declspec): Remove import/export defines if compiler
is MINGW.
* sched.h (declspec): Likewise.
* semaphore.h (declspec): Likewise.
* need_errno.h (declspec): Likewise.
* Makefile (autostatic.obj): Add for small static builds.
* GNUmakefile (autostatic.o): Likewise.
* NEWS (Version 2.9.0): Add changes.
* README.NONPORTABLE (pthread_win32_process_*): Update
description.
2010-06-15 Ramiro Polla <ramiro.polla at gmail.com >
* Makefile: Remove linkage with the winsock library by default.
* GNUmakefile: Likewise.
* pthread_getspecific.c: Likewise by removing calls to WSA
functions.
* config.h (RETAIN_WSALASTERROR): Can be defined if necessary.
2010-01-26 Ross Johnson <ross.johnson at homemail.com.au>
* ptw32_MCS_lock.c (ptw32_mcs_node_substitute): New routine
to allow relocating the lock owners thread-local node to somewhere
else, e.g. to global space so that another thread can release the
lock. Used in pthread_barrier_wait.
(ptw32_mcs_lock_try_acquire): New routine.
* pthread_barrier_init: Only one semaphore is used now.
* pthread_barrier_wait: Added an MCS guard lock with the last thread
to leave the barrier releasing the lock. This removes a deadlock bug
observed when there are greater than barrier-count threads
attempting to cross.
* pthread_barrier_destroy: Added an MCS guard lock.
2009-03-03 Stephan O'Farrill <stephan dot ofarrill at gmail dot com>
* pthread_attr_getschedpolicy.c: Add "const" to function parameter
in accordance with SUSv3 (POSIX).
* pthread_attr_getinheritsched.c: Likewise.
* pthread_mutexattr_gettype.c: Likewise.
2008-06-06 Robert Kindred <RKindred at SwRI dot edu>
* ptw32_throw.c (ptw32_throw): Remove possible reference to NULL
pointer. (At the same time made the switch block conditionally
included only if exitCode is needed - RPJ.)
* pthread_testcancel.c (pthread_testcancel): Remove duplicate and
misplaced pthread_mutex_unlock().
2008-02-21 Sebastian Gottschalk <seppig_relay at gmx dot de>
* pthread_attr_getdetachstate.c (pthread_attr_getdetachstate):
Remove potential and superfluous null pointer assignment.
2007-11-22 Ivan Pizhenko <ivanp4 at ua dot fm>
* pthread.h (gmtime_r): gmtime returns 0 if tm represents a time
prior to 1/1/1970. Notice this to prevent raising an exception.
* pthread.h (localtime_r): Likewise for localtime.
2007-07-14 Marcel Ruff <mr at marcelruff dot info>
* errno.c (_errno): Fix test for pthread_self() success.
* need_errno.h: Remove unintentional line wrap from #if line.
2007-07-14 Mike Romanchuk <mromanchuk at empirix dot com>
* pthread.h (timespec): Fix tv_sec type.
2007-01-07 Sinan Kaya <sinan.kaya at siemens dot com>
* need_errno.h: Fix declaration of _errno - the local version of
_errno() is used, e.g. by WinCE.
2007-01-06 Ross Johnson <ross.johnson at homemail dot com dot au>
* ptw32_semwait.c: Add check for invalid sem_t after acquiring the
sem_t state guard mutex and before affecting changes to sema state.
2007-01-06 Marcel Ruff <mr at marcelruff dot info>
* error.c: Fix reference to pthread handle exitStatus member for
builds that use NEED_ERRNO (i.e. WINCE).
* context.h: Add support for ARM processor (WinCE).
* mutex.c (process.h): Exclude for WINCE.
* create.c: Likewise.
* exit.c: Likewise.
* implement.h: Likewise.
* pthread_detach.c (signal.h): Exclude for WINCE.
* pthread_join.c: Likewise.
* pthread_kill.c: Likewise.
* pthread_rwlock_init.c (errno.h): Remove - included by pthread.h.
* pthread_rwlock_destroy.c: Likewise.
* pthread_rwlock_rdlock.c: Likewise.
* pthread_rwlock_timedrdlock.c: Likewise.
* pthread_rwlock_timedwrlock.c: Likewise.
* pthread_rwlock_tryrdlock.c: Likewise.
* pthread_rwlock_trywrlock.c: likewise.
* pthread_rwlock_unlock.c: Likewise.
* pthread_rwlock_wrlock.c: Likewise.
* pthread_rwlockattr_destroy.c: Likewise.
* pthread_rwlockattr_getpshared.c: Likewise.
* pthread_rwlockattr_init.c: Likewise.
* pthread_rwlockattr_setpshared.c: Likewise.
2007-01-06 Romano Paolo Tenca <rotenca at telvia dot it>
* pthread_cond_destroy.c: Replace sem_wait() with non-cancelable
ptw32_semwait() since pthread_cond_destroy() is not a cancellation
point.
* implement.h (ptw32_spinlock_check_need_init): Add prototype.
* ptw32_MCS_lock.c: Reverse order of includes.
2007-01-06 Eric Berge <eric dot berge at quantum dot com>
* pthread_cond_destroy.c: Add LeaveCriticalSection before returning
after errors.
2007-01-04 Ross Johnson <ross.johnson at homemail dot com dot au>
* ptw32_InterlockedCompareExchange.c: Conditionally skip for
Win64 as not required.
* pthread_win32_attach_detach_np.c (pthread_win32_process_attach_np):
Test for InterlockedCompareExchange is not required for Win64.
* context.h: New file. Included by pthread_cancel.h and any tests
that need it (e.g. context1.c).
* pthread_cancel.c: Architecture-dependent context macros moved
to context.h.
2007-01-04 Kip Streithorst <KSTREITH at ball dot com>
* implement.h (PTW32_INTERLOCKED_COMPARE_EXCHANGE): Add Win64
support.
2006-12-20 Ross Johnson <ross.johnson at homemail.com.au>
* sem_destroy.c: Fix the race involving invalidation of the sema;
fix incorrect return of EBUSY resulting from the mutex trylock
on the private mutex guard.
* sem_wait.c: Add check for invalid sem_t after acquiring the
sem_t state guard mutex and before affecting changes to sema state.
* sem_trywait.c: Likewise.
* sem_timedwait.c: Likewise.
* sem_getvalue.c: Likewise.
* sem_post.c: Similar.
* sem_post_multiple.c: Likewise.
* sem_init.c: Set max Win32 semaphore count to SEM_VALUE_MAX (was
_POSIX_SEM_VALUE_MAX, which is a lower value - the minimum).
* pthread_win32_attach_detach_np.c (pthread_win32_process_attach_np):
Load COREDLL.DLL under WINCE to check existence of
InterlockedCompareExchange() routine. This used to be done to test
for TryEnterCriticalSection() but was removed when this was no
longer needed.
2006-01-25 Prashant Thakre <prashant.thakre at gmail.com>
* pthread_cancel.c: Added _M_IA64 register context support.
2005-05-13 Ross Johnson <ross at callisto.canberra.edu.au>
* pthread_kill.c (pthread_kill): Remove check for Win32 thread
priority (to confirm HANDLE validity). Useless since thread HANDLEs
a not recycle-unique.
2005-05-30 Vladimir Kliatchko <vladimir at kliatchko.com>
* pthread_once.c: Re-implement using an MCS queue-based lock. The form
of pthread_once is as proposed by Alexander Terekhov (see entry of
2005-03-13). The MCS lock implementation does not require a unique
'name' to identify the lock between threads. Attempts to get the Event
or Semaphore based versions of pthread_once to a satisfactory level
of robustness have thus far failed. The last problem (avoiding races
involving non recycle-unique Win32 HANDLEs) was giving everyone
grey hair trying to solve it.
* ptw32_MCS_lock.c: New MCS queue-based lock implementation. These
locks are efficient: they have very low overhead in the uncontended case;
are efficient in contention and minimise cache-coherence updates in
managing the user level FIFO queue; do not require an ABI change in the
library.
2005-05-27 Alexander Gottwald <alexander.gottwald at s1999.tu-chemnitz.de>
* pthread.h: Some things, like HANDLE, were only defined if
PTW32_LEVEL was >= 3. They should always be defined.
2005-05-25 Vladimir Kliatchko <vladimir at kliatchko.com>
* pthread_once.c: Eliminate all priority operations and other
complexity by replacing the event with a semaphore. The advantage
of the change is the ability to release just one waiter if the
init_routine thread is cancelled yet still release all waiters when
done. Simplify once_control state checks to improve efficiency
further.
2005-05-24 Mikael Magnusson <mikaelmagnusson at glocalnet.net>
* GNUmakefile: Patched to allow cross-compile with mingw32 on Linux.
It uses macros instead of referencing dlltool, gcc and g++ directly;
added a call to ranlib. For example the GC static library can be
built with:
make CC=i586-mingw32msvc-gcc RC=i586-mingw32msvc-windres \
RANLIB=i586-mingw32msvc-ranlib clean GC-static
2005-05-13 Ross Johnson <ross at callisto.canberra.edu.au>
* pthread_win32_attach_detach_np.c (pthread_win32_thread_detach_np):
Move on-exit-only stuff from ptw32_threadDestroy() to here.
* ptw32_threadDestroy.c: It's purpose is now only to reclaim thread
resources for detached threads, or via pthread_join() or
pthread_detach() on joinable threads.
* ptw32_threadStart.c: Calling user destruct routines has moved to
pthread_win32_thread_detach_np(); call pthread_win32_thread_detach_np()
directly if statically linking, otherwise do so via dllMain; store
thread return value in thread struct for all cases, including
cancellation and exception exits; thread abnormal exits go via
pthread_win32_thread_detach_np.
* pthread_join.c (pthread_join): Don't try to get return code from
Win32 thread - always get it from he thread struct.
* pthread_detach.c (pthread_detach): reduce extent of the thread
existence check since we now don't care if the Win32 thread HANDLE has
been closed; reclaim thread resources if the thread has exited already.
* ptw32_throw.c (ptw32_throw): For Win32 threads that are not implicit,
only Call thread cleanup if statically linking, otherwise leave it to
dllMain.
* sem_post.c (_POSIX_SEM_VALUE_MAX): Change to SEM_VALUE_MAX.
* sem_post_multiple.c: Likewise.
* sem_init.c: Likewise.
2005-05-10 Ross Johnson <ross at callisto.canberra.edu.au>
* pthread_join.c (pthread_join): Add missing check for thread ID
reference count in thread existence test; reduce extent of the
existence test since we don't care if the Win32 thread HANDLE has
been closed.
2005-05-09 Ross Johnson <ross at callisto.canberra.edu.au>
* ptw32_callUserDestroyRoutines.c: Run destructor process (i.e.
loop over all keys calling destructors) up to
PTHREAD_DESTRUCTOR_ITERATIONS times if TSD value isn't NULL yet;
modify assoc management.
* pthread_key_delete.c: Modify assoc management.
* ptw32_tkAssocDestroy.c: Fix error in assoc removal from chains.
* pthread.h
(_POSIX_THREAD_DESTRUCTOR_ITERATIONS): Define to value specified by
POSIX.
(_POSIX_THREAD_KEYS_MAX): Define to value specified by POSIX.
(PTHREAD_KEYS_MAX): Redefine [upward] to minimum required by POSIX.
(SEM_NSEMS_MAX): Define to implementation value.
(SEM_VALUE_MAX): Define to implementation value.
(_POSIX_SEM_NSEMS_MAX): Redefine to value specified by POSIX.
(_POSIX_SEM_VALUE_MAX): Redefine to value specified by POSIX.
2005-05-06 Ross Johnson <ross at callisto.canberra.edu.au>
* signal.c (sigwait): Add a cancellation point to this otherwise
no-op.
* sem_init.c (sem_init): Check for and return ERANGE error.
* sem_post.c (sem_post): Likewise.
* sem_post_multiple.c (sem_post_multiple): Likewise.
* manual (directory): Added; see ChangeLog inside.
2005-05-02 Ross Johnson <ross at callisto.canberra.edu.au>
* implement.h (struct pthread_key_t_): Change threadsLock to keyLock
so as not to be confused with the per thread lock 'threadlock';
change all references to it.
* implement.h (struct ThreadKeyAssoc): Remove lock; add prevKey
and prevThread pointers; re-implemented all routines that use this
struct. The effect of this is to save one handle per association,
which could potentially equal the number of keys multiplied by the
number of threads, accumulating over time - and to free the
association memory as soon as it is no longer referenced by either
the key or the thread. Previously, the handle and memory were
released only after BOTH key and thread no longer referenced the
association. That is, often no association resources were released
until the process itself exited. In addition, at least one race
condition has been removed - where two threads could attempt to
release the association resources simultaneously - one via
ptw32_callUserDestroyRoutines and the other via
pthread_key_delete.
- thanks to Richard Hughes at Aculab for discovering the problem.
* pthread_key_create.c: See above.
* pthread_key_delete.c: See above.
* pthread_setspecific.c: See above.
* ptw32_callUserDestroyRoutines.c: See above.
* ptw32_tkAssocCreate.c: See above.
* ptw32_tkAssocDestroy.c: See above.
2005-04-27 Ross Johnson <ross at callisto.canberra.edu.au>
* sem_wait.c (ptw32_sem_wait_cleanup): after cancellation re-attempt
to acquire the semaphore to avoid a race with a late sem_post.
* sem_timedwait.c: Modify comments.
2005-04-25 Ross Johnson <ross at callisto.canberra.edu.au>
* ptw32_relmillisecs.c: New module; converts future abstime to
milliseconds relative to 'now'.
* pthread_mutex_timedlock.c: Use new ptw32_relmillisecs routine in
place of internal code; remove the NEED_SEM code - this routine is now
implemented for builds that define NEED_SEM (WinCE etc)
* sem_timedwait.c: Likewise; after timeout or cancellation,
re-attempt to acquire the semaphore in case one has been posted since
the timeout/cancel occurred. Thanks to Stefan Mueller.
* Makefile: Add ptw32_relmillisecs.c module; remove
ptw32_{in,de}crease_semaphore.c modules.
* GNUmakefile: Likewise.
* Bmakefile: Likewise.
* sem_init.c: Re-write the NEED_SEM code to be consistent with the
non-NEED_SEM code, but retaining use of an event in place of the w32 sema
for w32 systems that don't include semaphores (WinCE);
the NEED_SEM versions of semaphores has been broken for a long time but is
now fixed and supports all of the same routines as the non-NEED_SEM case.
* sem_destroy.c: Likewise.
* sem_wait.c: Likewise.
* sem_post.c: Likewise.
* sem_post_multple.c: Likewise.
* implement.h: Likewise.
* sem_timedwait.c: Likewise; this routine is now
implemented for builds that define NEED_SEM (WinCE etc).
* sem_trywait.c: Likewise.
* sem_getvalue.c: Likewise.
* pthread_once.c: Yet more changes, reverting closer to Gottlob Frege's
first design, but retaining cancellation, priority boosting, and adding
preservation of W32 error codes to make pthread_once transparent to
GetLastError.
2005-04-11 Ross Johnson <ross at callisto.canberra.edu.au>
* pthread_once.c (pthread_once): Added priority boosting to
solve starvation problem after once_routine cancellation.
See notes in file.
2005-04-06 Kevin Lussier <Kevin at codegreennetworks.com>
* Makefile: Added debug targets for all versions of the library.
2005-04-01 Ross Johnson <ross at callisto.canberra.edu.au>
* GNUmakefile: Add target to build libpthreadGC1.a as a static link
library.
* Makefile: Likewise for pthreadGC1.lib.
2005-04-01 Kevin Lussier <Kevin at codegreennetworks.com>
* sem_timedwait.c (sem_timedwait): Increase size of temp variables to
avoid int overflows for large timeout values.
* implement.h (int64_t): Include or define.
2005-03-31 Dimitar Panayotov <develop at mail.bg>^M
* pthread.h: Fix conditional defines for static linking.
* sched.h: Liekwise.
* semaphore.h: Likewise.
* dll.c (PTW32_STATIC_LIB): Module is conditionally included
in the build.
2005-03-16 Ross Johnson <ross at callisto.canberra.edu.au>^M
* pthread_setcancelstate.c: Undo the last change.
2005-03-16 Ross Johnson <ross at callisto.canberra.edu.au>^M
* pthread_setcancelstate.c: Don't check for an async cancel event