-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChangeLog
5211 lines (3869 loc) · 196 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
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 cancelation
point.
* implement.h (ptw32_spinlock_check_need_init): Add prototype.
* ptw32_MCS_lock.c: Reverse order of includes.
2007-01-06 Eric Berge <eric dot berge at quantum dot com>
* pthread_cond_destroy.c: Add LeaveCriticalSection before returning
after errors.
2007-01-04 Ross Johnson <ross.johnson at homemail dot com dot au>
* ptw32_InterlockedCompareExchange.c: Conditionally skip for
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
if the library is using alertable async cancel..
2005-03-14 Ross Johnson <ross at callisto.canberra.edu.au>
* pthread_once.c (pthread_once): Downgrade interlocked operations to simple
memory operations where these are protected by the critical section; edit
comments.
2005-03-13 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_once.c (pthread_once): Completely redesigned; a change was
required to the ABI (pthread_once_t_), and resulting in a version
compatibility index increment.
NOTES:
The design (based on pseudo code contributed by Gottlob Frege) avoids
creating a kernel object if there is no contention. See URL for details:-
http://sources.redhat.com/ml/pthreads-win32/2005/msg00029.html
This uses late initialisation similar to the technique already used for
pthreads-win32 mutexes and semaphores (from Alexander Terekhov).
The subsequent cancelation cleanup additions (by rpj) could not be implemented
without sacrificing some of the efficiency in Gottlob's design. In particular,
although each once_control uses it's own event to block on, a global CS is
required to manage it - since the event must be either re-usable or
re-creatable under cancelation. This is not needed in the non-cancelable
design because it is able to mark the event as closed (forever).
When uncontested, a CS operation is equivalent to an Interlocked operation
in speed. So, in the final design with cancelability, an uncontested
once_control operation involves a minimum of five interlocked operations
(including the LeaveCS operation).
ALTERNATIVES:
An alternative design from Alexander Terekhov proposed using a named mutex,
as sketched below:-
if (!once_control) { // May be in TLS
named_mutex::guard guard(&once_control2);
if (!once_control2) {
<init>
once_control2 = true;
}
once_control = true;
}
A more detailed description of this can be found here:-
http://groups.yahoo.com/group/boost/message/15442
[Although the definition of a suitable PTHREAD_ONCE_INIT precludes use of the
TLS located flag, this is not critical.]
There are three primary concerns though:-
1) The [named] mutex is 'created' even in the uncontended case.
2) A system wide unique name must be generated.
3) Win32 mutexes are VERY slow even in the uncontended case. An uncontested
Win32 mutex lock operation can be 50 (or more) times slower than an
uncontested EnterCS operation.
Ultimately, the named mutex trick is making use of the global locks maintained
by the kernel.
* pthread.h (pthread_once_t_): One flag and an event HANDLE added.
(PTHREAD_ONCE_INIT): Additional values included.
2005-03-08 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_once.c (pthread_once): Redesigned to elliminate potential
starvation problem.
- reported by Gottlob Frege <gottlobfrege at gmail.com>
* ptw32_threadDestroy.c (ptw32_threadDestroy): Implicit threads were
not closing their Win32 thread duplicate handle.
- reported by Dmitrii Semii <bogolt at gmail.com>
2005-01-25 Ralf Kubis <RKubis at mc.com>
* Attempted acquisition of recursive mutex was causing waiting
threads to not be woken when the mutex is released.
* GNUmakefile (GCE): Generate correct version resource comments.
2005-01-01 Konstantin Voronkov <beowinkle at yahoo.com>
* pthread_mutex_lock.c (pthread_mutex_lock): The new atomic exchange
mutex algorithm is known to allow a thread to steal the lock off
FIFO waiting threads. The next waiting FIFO thread gets a spurious
wake-up and must attempt to re-acquire the lock. The woken thread
was setting itself as the mutex's owner before the re-acquisition.
2004-11-22 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_cond_wait.c (ptw32_cond_wait_cleanup): Undo change
from 2004-11-02.
* Makefile (DLL_VER): Added for DLL naming suffix - see README.
* GNUmakefile (DLL_VER): Likewise.
* Wmakefile (DLL_VER): Likewise.
* Bmakefile (DLL_VER): Likewise.
* pthread.dsw (version.rc): Added to MSVS workspace.
2004-11-20 Boudewijn Dekker <b.dekker at ellipsis.nl>
* pthread_getspecific.c (pthread_getspecific): Check for
invalid (NULL) key argument.
2004-11-19 Ross Johnson <rpj at callisto.canberra.edu.au>
* config.h (PTW32_THREAD_ID_REUSE_INCREMENT): Added to allow
building the library for either unique thread IDs like Solaris
or non-unique thread IDs like Linux; allows application developers
to override the library's default insensitivity to some apps
that may not be strictly POSIX compliant.
* version.rc: New resource module to encode version information
within the DLL.
* pthread.h: Added PTW32_VERSION* defines and grouped sections
required by resource compiler together; bulk of file is skipped
if RC_INVOKED. Defined some error numbers and other names for
Borland compiler.
2004-11-02 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_cond_wait.c (ptw32_cond_wait_cleanup): Lock CV mutex at
start of cleanup handler rather than at the end.
* implement.h (PTW32_THREAD_REUSE_EMPTY): Renamed from *_BOTTOM.
(ptw32_threadReuseBottom): New global variable.
* global.c (ptw32_threadReuseBottom): Declare new variable.
* ptw32_reuse.c (ptw32_reuse): Change reuse LIFO stack to LILO queue
to more evenly distribute use of reusable thread IDs; use renamed
PTW32_THREAD_REUSE_EMPTY.
* ptw32_processTerminate.c (ptw2_processTerminate): Use renamed
PTW32_THREAD_REUSE_EMPTY.
2004-10-31 Ross Johnson <rpj at callisto.canberra.edu.au>
* implement.h (PThreadState): Add new state value
'PThreadStateCancelPending'.
* pthread_testcancel.c (pthread_testcancel): Use new thread
'PThreadStateCancelPending' state as short cut to avoid entering
kernel space via WaitForSingleObject() call. This was obviated
by user space sema acquisition in sem_wait() and sem_timedwait(),
which are also cancelation points. A call to pthread_testcancel()
was required, which introduced a kernel call, effectively nullifying
any gains made by the user space sem acquisition checks.
* pthread_cancel.c (pthread_cancel): Set new thread
'PThreadStateCancelPending' state.
2004-10-29 Ross Johnson <rpj at callisto.canberra.edu.au>
* implement.h (pthread_t): Renamed to ptw32_thread_t; struct contains
all thread state.
* pthread.h (ptw32_handle_t): New general purpose struct to serve
as a handle for various reusable object IDs - currently only used
by pthread_t; contains a pointer to ptw32_thread_t (thread state)
and a general purpose uint for use as a reuse counter or flags etc.
(pthread_t): typedef'ed to ptw32_handle_t; the uint is the reuse
counter that allows the library to maintain unique POSIX thread IDs.
When the pthread struct reuse stack was introduced, threads would
often acquire an identical ID to a previously destroyed thread. The
same was true for the pre-reuse stack library, by virtue of pthread_t
being the address of the thread struct. The new pthread_t retains
the reuse stack but provides virtually unique thread IDs.
* sem_wait.c (ptw32_sem_wait_cleanup): New routine used for
cancelation cleanup.
* sem_timedwait.c (ptw32_sem_timedwait_cleanup): Likewise.
2004-10-22 Ross Johnson <rpj at callisto.canberra.edu.au>
* sem_init.c (sem_init): Introduce a 'lock' element in order to
replace the interlocked operations with conventional serialisation.
This is needed in order to be able to atomically modify the sema
value and perform Win32 sema release operations. Win32 semaphores are
used instead of events in order to support efficient multiple posting.
If the whole modify/release isn't atomic, a race between
sem_timedwait() and sem_post() could result in a release when there is
no waiting semaphore, which would cause too many threads to proceed.
* sem_wait.c (sem_wait): Use new 'lock'element.
* sem_timedwait.c (sem_timedwait): Likewise.
* sem_trywait.c (sem_trywait): Likewise.
* sem_post.c (sem_post): Likewise.
* sem_post_multiple.c (sem_post_multiple): Likewise.
* sem_getvalue.c (sem_getvalue): Likewise.
* ptw32_semwait.c (ptw32_semwait): Likewise.
* sem_destroy.c (sem_destroy): Likewise; also tightened the conditions
for semaphore destruction; in particular, a semaphore will not be
destroyed if it has waiters.
* sem_timedwait.c (sem_timedwait): Added cancel cleanup handler to
restore sema value when cancelled.
* sem_wait.c (sem_wait): Likewise.
2004-10-21 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_mutex_unlock.c (pthread_mutex_unlock): Must use PulseEvent()
rather than SetEvent() to reset the event if there are no waiters.
2004-10-19 Ross Johnson <rpj at callisto.canberra.edu.au>
* sem_init.c (sem_init): New semaphore model based on the same idea
as mutexes, i.e. user space interlocked check to avoid
unnecessarily entering kernel space. Wraps the Win32 semaphore and
keeps it's own counter. Although the motivation to do this has existed
for a long time, credit goes to Alexander Terekhov for providing
the logic. I have deviated slightly from AT's logic to add the waiters
count, which has made the code more complicated by adding cancelation
cleanup. This also appears to have broken the VCE (C++ EH) version of
the library (the same problem as previously reported - see BUGS #2),
only apparently not fixable using the usual workaround, nor by turning
all optimisation off. The GCE version works fine, so it is presumed to
be a bug in MSVC++ 6.0. The cancelation exception is thrown and caught
correctly, but the cleanup class destructor is never called. The failing
test is tests\semaphore4.c.
* sem_wait.c (sem_wait): Implemented user space check model.
* sem_post.c (sem_post): Likewise.
* sem_trywait.c (sem_trywait): Likewise.
* sem_timedwait.c (sem_timedwait): Likewise.
* sem_post_multiple.c (sem_post_multiple): Likewise.
* sem_getvalue.c (sem_getvalue): Likewise.
* ptw32_semwait.c (ptw32_semwait): Likewise.
* implement.h (sem_t_): Add counter element.
2004-10-15 Ross Johnson <rpj at callisto.canberra.edu.au>
* implement.h (pthread_mutex_t_): Use an event in place of
the POSIX semaphore.
* pthread_mutex_init.c: Create the event; remove semaphore init.
* pthread_mutex_destroy.c: Delete the event.
* pthread_mutex_lock.c: Replace the semaphore wait with the event wait.
* pthread_mutex_trylock.c: Likewise.
* pthread_mutex_timedlock.c: Likewise.
* pthread_mutex_unlock.c: Set the event.
2004-10-14 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_mutex_lock.c (pthread_mutex_lock): New algorithm using
Terekhov's xchg based variation of Drepper's cmpxchg model.
Theoretically, xchg uses fewer clock cycles than cmpxchg (using IA-32
as a reference), however, in my opinion bus locking dominates the
equation on smp systems, so the model with the least number of bus
lock operations in the execution path should win, which is Terekhov's
variant. On IA-32 uni-processor systems, it's faster to use the
CMPXCHG instruction without locking the bus than to use the XCHG
instruction, which always locks the bus. This makes the two variants
equal for the non-contended lock (fast lane) execution path on up
IA-32. Testing shows that the xchg variant is faster on up IA-32 as
well if the test forces higher lock contention frequency, even though
kernel calls should be dominating the times (on up IA-32, both
variants used CMPXCHG instructions and neither locked the bus).
* pthread_mutex_timedlock.c pthread_mutex_timedlock(): Similarly.
* pthread_mutex_trylock.c (pthread_mutex_trylock): Similarly.
* pthread_mutex_unlock.c (pthread_mutex_unlock): Similarly.
* ptw32_InterlockedCompareExchange.c (ptw32_InterlockExchange): New
function.
(PTW32_INTERLOCKED_EXCHANGE): Sets up macro to use inlined
ptw32_InterlockedExchange.
* implement.h (PTW32_INTERLOCKED_EXCHANGE): Set default to
InterlockedExchange().
* Makefile: Building using /Ob2 so that asm sections within inline
functions are inlined.
2004-10-08 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_mutex_destroy.c (pthread_mutex_destroy): Critical Section
element is no longer required.
* pthread_mutex_init.c (pthread_mutex_init): Likewise.
* pthread_mutex_lock.c (pthread_mutex_lock): New algorithm following
Drepper's paper at http://people.redhat.com/drepper/futex.pdf, but
using the existing semaphore in place of the futex described in the
paper. Idea suggested by Alexander Terekhov - see:
http://sources.redhat.com/ml/pthreads-win32/2003/msg00108.html
* pthread_mutex_timedlock.c pthread_mutex_timedlock(): Similarly.
* pthread_mutex_trylock.c (pthread_mutex_trylock): Similarly.
* pthread_mutex_unlock.c (pthread_mutex_unlock): Similarly.
* pthread_barrier_wait.c (pthread_barrier_wait): Use inlined version
of InterlockedCompareExchange() if possible - determined at
build-time.
* pthread_spin_destroy.c pthread_spin_destroy(): Likewise.
* pthread_spin_lock.c pthread_spin_lock():Likewise.
* pthread_spin_trylock.c (pthread_spin_trylock):Likewise.
* pthread_spin_unlock.c (pthread_spin_unlock):Likewise.
* ptw32_InterlockedCompareExchange.c: Sets up macro for inlined use.
* implement.h (pthread_mutex_t_): Remove Critical Section element.
(PTW32_INTERLOCKED_COMPARE_EXCHANGE): Set to default non-inlined
version of InterlockedCompareExchange().
* private.c: Include ptw32_InterlockedCompareExchange.c first for
inlining.
* GNUmakefile: Add commandline option to use inlined
InterlockedCompareExchange().
* Makefile: Likewise.
2004-09-27 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_mutex_lock.c (pthread_mutex_lock): Separate
PTHREAD_MUTEX_NORMAL logic since we do not need to keep or check some
state required by other mutex types; do not check mutex pointer arg
for validity - leave this to the system since we are only checking
for NULL pointers. This should improve speed of NORMAL mutexes and
marginally improve speed of other type.
* pthread_mutex_trylock.c (pthread_mutex_trylock): Likewise.
* pthread_mutex_unlock.c (pthread_mutex_unlock): Likewise; also avoid
entering the critical section for the no-waiters case, with approx.
30% reduction in lock/unlock overhead for this case.
* pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise; also
no longer keeps mutex if post-timeout second attempt succeeds - this
will assist applications that wish to impose strict lock deadlines,
rather than simply to escape from frozen locks.
2004-09-09 Tristan Savatier <tristan at mpegtv.com>
* pthread.h (struct pthread_once_t_): Qualify the 'done' element
as 'volatile'.
* pthread_once.c: Concerned about possible race condition,
specifically on MPU systems re concurrent access to multibyte types.
[Maintainer's note: the race condition is harmless on SPU systems
and only a problem on MPU systems if concurrent access results in an
exception (presumably generated by a hardware interrupt). There are
other instances of similar harmless race conditions that have not
been identified as issues.]
2004-09-09 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread.h: Declare additional types as volatile.
2004-08-27 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_barrier_wait.c (pthread_barrier_wait): Remove excessive code
by substituting the internal non-cancelable version of sem_wait
(ptw32_semwait).
2004-08-25 Ross Johnson <rpj at callisto.canberra.edu.au>
* pthread_join.c (pthread_join): Rewrite and re-order the conditional
tests in an attempt to improve efficiency and remove a race
condition.
2004-08-23 Ross Johnson <rpj at callisto.canberra.edu.au>
* create.c (pthread_create): Don't create a thread if the thread
id pointer location (first arg) is inaccessible. A memory
protection fault will result if the thread id arg isn't an accessible
location. This is consistent with GNU/Linux but different to
Solaris or MKS (and possibly others), which accept NULL as meaning
'don't return the created thread's ID'. Applications that run
using pthreads-win32 will run on all other POSIX threads
implementations, at least w.r.t. this feature.
It was decided not to copy the Solaris et al behaviour because,
although it would have simplified some application porting (but only
from Solaris to Windows), the feature is not technically necessary,
and the alternative segfault behaviour helps avoid buggy application
code.
2004-07-01 Anuj Goyal <anuj.goyal at gmail.com>
* builddmc.bat: New; Windows bat file to build the library.
* config.h (__DMC__): Support for Digital Mars compiler.
* create.c (__DMC__): Likewise.
* pthread_exit.c (__DMC__): Likewise.
* pthread_join.c (__DMC__): Likewise.
* ptw32_threadDestroy.c (__DMC__): Likewise.
* ptw32_threadStart.c (__DMC__): Likewise.
* ptw32_throw.c (__DMC__): Likewise.
2004-06-29 Anuj Goyal <anuj.goyal at gmail.com>
* pthread.h (__DMC__): Initial support for Digital Mars compiler.
2004-06-29 Will Bryant <will.bryant at ecosm.com>
* README.Borland: New; description of Borland changes.
* Bmakefile: New makefile for the Borland make utility.
* ptw32_InterlockedCompareExchange.c:
Add Borland compatible asm code.
2004-06-26 Jason Bard <BardJA at Npt.NUWC.Navy.Mil>
* pthread.h (HAVE_STRUCT_TIMESPEC): If undefined, define it
to avoid timespec struct redefined errors elsewhere in an