ChangeLog
上传用户:zhenyu
上传日期:2022-04-24
资源大小:268k
文件大小:181k
- 2006-12-20 Ross Johnson <ross.johnson@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 testssemaphore4.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
- application.
- 2004-06-21 Ross Johnson <rpj at callisto.canberra.edu.au>
- * pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Mutex
- initialiser added for compatibility with Linux threads and
- others; currently not included in SUSV3.
- * pthread.h (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER): Likewise.
- * pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Likewise.
- * pthread.h (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
- * ptw32_mutex_check_need_init.c (ptw32_mutex_check_need_init):
- Add new initialisers.
- * pthread_mutex_lock.c (pthread_mutex_lock): Check for new
- initialisers.
- * pthread_mutex_trylock.c (pthread_mutex_trylock): Likewise.
- * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.
- * pthread_mutex_unlock.c (pthread_mutex_unlock): Likewise.
- * pthread_mutex_destroy.c (pthread_mutex_destroy): Likewise.
- 2004-05-20 Ross Johnson <rpj at callisto.canberra.edu.au>
- * README.NONPORTABLE: Document pthread_win32_test_features_np().
- * FAQ: Update various answers.
- 2004-05-19 Ross Johnson <rpj at callisto.canberra.edu.au>
- * Makefile: Don't define _WIN32_WINNT on compiler command line.
- * GNUmakefile: Likewise.
- 2004-05-16 Ross Johnson <rpj at callisto.canberra.edu.au>
- * pthread_cancel.c (pthread_cancel): Adapted to use auto-detected
- QueueUserAPCEx features at run-time.
- (ptw32_RegisterCancelation): Drop in replacement for QueueUserAPCEx()
- if it can't be used. Provides older style non-preemptive async
- cancelation.
- * pthread_win32_attach_detach_np.c (pthread_win32_attach_np):
- Auto-detect quserex.dll and the availability of alertdrv.sys;
- initialise and close on process attach/detach.
- * global.c (ptw32_register_cancelation): Pointer to either
- QueueUserAPCEx() or ptw32_RegisterCancelation() depending on
- availability. QueueUserAPCEx makes pre-emptive async cancelation
- possible.
- * implement.h: Add definitions and prototypes related to QueueUserAPC.
- 2004-05-16 Panagiotis E. Hadjidoukas <peh at hpclab.ceid.upatras.gr>
- * QueueUserAPCEx (separate contributed package): Provides preemptive
- APC feature.
- * pthread_cancel.c (pthread_cancel): Initial integration of
- QueueUserAPCEx into pthreads-win32 to provide true pre-emptive
- async cancelation of threads, including blocked threads.
- 2004-05-06 Makoto Kato <raven at oldskool.jp>
- * pthread.h (DWORD_PTR): Define typedef for older MSVC.
- * pthread_cancel.c (AMD64): Add architecture specific Context register.
- * ptw32_getprocessors.c: Use correct types (DWORD_PTR) for mask
- variables.
- 2004-04-06 P. van Bruggen <pietvb at newbridges.nl>
- * ptw32_threadDestroy.c: Destroy threadLock mutex to
- close a memory leak.
- 2004-02-13 Gustav Hallberg <gustav at virtutech.com>
- * pthread_equal.c: Remove redundant equality logic.
- 2003-12-10 Philippe Di Cristo <philipped at voicebox.com>
- * sem_timedwait.c (sem_timedwait): Fix timeout calculations.
- 2003-10-20 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * pthread_mutex_timedlock.c (ptw32_semwait): Move to individual module.
- * ptw32_semwait.c: New module.
- * pthread_cond_wait.c (ptw32_cond_wait_cleanup): Replace cancelable
- sem_wait() call with non-cancelable ptw32_semwait() call.
- * pthread.c (private.c): Re-order for inlining. GNU C warned that
- function ptw32_semwait() was defined 'inline' after it was called.
- * pthread_cond_signal.c (ptw32_cond_unblock): Likewise.
- * pthread_delay_np.c: Disable Watcom warning with comment.
- * *.c (process.h): Remove include from .c files. This is conditionally
- included by the common project include files.
- 2003-10-20 James Ewing <james.ewing at sveasoft.com>
- * ptw32_getprocessors.c: Some Win32 environments don't have
- GetProcessAffinityMask(), so always return CPU count = 1 for them.
- * config.h (NEED_PROCESSOR_AFFINITY_MASK): Define for WinCE.
-
- 2003-10-15 Ross Johnson <ross at callisto.canberra.edu.au>
- * Re-indented all .c files using default GNU style to remove assorted
- editor ugliness (used GNU indent utility in default style).
- 2003-10-15 Alex Blanco <Alex.Blanco at motorola.com>
- * sem_init.c (sem_init): Would call CreateSemaphore even if the sema
- struct calloc failed; was not freeing calloced memory if either
- CreateSemaphore or CreateEvent failed.
- 2003-10-14 Ross Johnson <ross at callisto.canberra.edu.au>
- * pthread.h: Add Watcom compiler compatibility. Esssentially just add
- the cdecl attribute to all exposed function prototypes so that Watcom
- generates function call code compatible with non-Watcom built libraries.
- By default, Watcom uses registers to pass function args if possible rather
- than pushing to stack.
- * semaphore.h: Likewise.
- * sched.h: Likewise.
- * pthread_cond_wait.c (ptw32_cond_wait_cleanup): Define with cdecl attribute
- for Watcom compatibility. This routine is called via pthread_cleanup_push so
- it had to match function arg definition.
- * Wmakefile: New makefile for Watcom builds.
- 2003-09-14 Ross Johnson <rpj at callisto.canberra.edu.au>
- * pthread_setschedparam.c (pthread_setschedparam): Attempt to map
- all priority levels between max and min (as returned by
- sched_get_priority_min/max) to reasonable Win32 priority levels - i.e.
- levels between THREAD_PRIORITY_LOWEST/IDLE to THREAD_PRIORITY_LOWEST and
- between THREAD_PRIORITY_HIGHEST/TIME_CRITICAL to THREAD_PRIORITY_HIGHEST
- while others remain unchanged; record specified thread priority level
- for return by pthread_getschedparam.
- Note that, previously, specified levels not matching Win32 priority levels
- would silently leave the current thread priority unaltered.
- * pthread_getschedparam.c (pthread_getschedparam): Return the priority
- level specified by the latest pthread_setschedparam or pthread_create rather
- than the actual running thread priority as returned by GetThreadPriority - as
- required by POSIX. I.e. temporary or adjusted actual priority levels are not
- returned by this routine.
- * pthread_create.c (pthread_create): For priority levels specified via
- pthread attributes, attempt to map all priority levels between max and
- min (as returned by sched_get_priority_min/max) to reasonable Win32
- priority levels; record priority level given via attributes, or
- inherited from parent thread, for later return by pthread_getschedparam.
- * ptw32_new.c (ptw32_new): Initialise pthread_t_ sched_priority element.
- * pthread_self.c (pthread_self): Set newly created implicit POSIX thread
- sched_priority to Win32 thread's current actual priority. Temporarily
- altered priorities can't be avoided in this case.
- * implement.h (struct pthread_t_): Add new sched_priority element.
- 2003-09-12 Ross Johnson <rpj at callisto.canberra.edu.au>
- * sched_get_priority_min.c (sched_get_priority_min): On error should return -1
- with errno set.
- * sched_get_priority_max.c (sched_get_priority_max): Likewise.
- 2003-09-03 Ross Johnson <rpj at callisto.canberra.edu.au>
- * w32_cancelableWait.c (ptw32_cancelable_wait): Allow cancelation
- of implicit POSIX threads as well.
- 2003-09-02 Ross Johnson <rpj at callisto.canberra.edu.au>
- * pthread_win32_attach_detach_np.c (pthread_win32_thread_detach_np):
- Add comment.
- * pthread_exit.c (pthread_exit): Fix to recycle the POSIX thread handle in
- addition to calling user TSD destructors. Move the implicit POSIX thread exit
- handling to ptw32_throw to centralise the logic.
- * ptw32_throw.c (ptw32_throw): Implicit POSIX threads have no point
- to jump or throw to, so cleanup and exit the thread here in this case. For
- processes using the C runtime, the exit code will be set to the POSIX
- reason for the throw (i.e. PTHREAD_CANCEL or the value given to pthread_exit).
- Note that pthread_exit() already had similar logic, which has been moved to
- here.
- * ptw32_threadDestroy.c (ptw32_threadDestroy): Don't close the Win32 handle
- of implicit POSIX threads - expect this to be done by Win32?
- 2003-09-01 Ross Johnson <rpj at callisto.canberra.edu.au>
- * pthread_self.c (pthread_self): The newly aquired pthread_t must be
- assigned to the reuse stack, not freed, if the routine fails somehow.
- 2003-08-13 Ross Johnson <rpj at ise.canberra.edu.au>
- * pthread_getschedparam.c (pthread_getschedparam): An invalid thread ID
- parameter was returning an incorrect error value; now uses a more exhaustive
- check for validity.
- * pthread_setschedparam.c (pthread_setschedparam): Likewise.
- * pthread_join.c (pthread_join): Now uses a more exhaustive
- check for validity.
- * pthread_detach.c (pthread_detach): Likewise.
- * pthread_cancel.c (pthread_cancel): Likewise.
- * ptw32_threadDestroy.c (ptw32_threadDestroy): pthread_t structs are
- never freed - push them onto a stack for reuse.
- * ptw32_new.c (ptw32_new): Check for reusable pthread_t before dynamically
- allocating new memory for the struct.
- * pthread_kill.c (pthread_kill): New file; new routine; takes only a zero
- signal arg so that applications can check the thread arg for validity; checks
- that the underlying Win32 thread HANDLE is valid.
- * pthread.h (pthread_kill): Add prototype.
- * ptw32_reuse.c (ptw32_threadReusePop): New file; new routine; pop a
- pthread_t off the reuse stack. pthread_t_ structs that have been destroyed, i.e.
- have exited detached or have been joined, are cleaned up and put onto a reuse
- stack. Consequently, thread IDs are no longer freed once calloced. The library
- will attempt to get a struct off this stack before asking the system to alloc
- new memory when creating threads. The stack is guarded by a global mutex.
- (ptw32_threadReusePush): New routine; push a pthread_t onto the reuse stack.
- * implement.h (ptw32_threadReusePush): Add new prototype.
- (ptw32_threadReusePop): Likewise.
- (pthread_t): Add new element.
- * ptw32_processTerminate.c (ptw32_processTerminate): Delete the thread
- reuse lock; free all thread ID structs on the thread reuse stack.
- * ptw32_processInitialize.c (ptw32_processInitialize): Initialise the
- thread reuse lock.
- 2003-07-19 Ross Johnson <rpj at ise.canberra.edu.au>
- * GNUmakefile: modified to work under MsysDTK environment.
- * pthread_spin_lock.c (pthread_spin_lock): Check for NULL arg.
- * pthread_spin_unlock.c (pthread_spin_unlock): Likewise.
- * pthread_spin_trylock.c (pthread_spin_trylock): Likewise;
- fix incorrect pointer value if lock is dynamically initialised by
- this function.
- * sem_init.c (sem_init): Initialise sem_t value to quell compiler warning.
- * sem_destroy.c (sem_destroy): Likewise.
- * ptw32_threadStart.c (non-MSVC code sections): Include <exception> rather
- than old-style <new.h>; fix all std:: namespace entities such as
- std::terminate_handler instances and associated methods.
- * ptw32_callUserDestroyRoutines.c (non-MSVC code sections): Likewise.
- 2003-06-24 Piet van Bruggen <pietvb at newbridges.nl>
- * pthread_spin_destroy.c (pthread_spin_destroy): Was not freeing the
- spinlock struct.
- 2003-06-22 Nicolas Barry <boozai at yahoo.com>
- * pthread_mutex_destroy.c (pthread_mutex_destroy): When called
- with a recursive mutex that was locked by the current thread, the
- function was failing with a success return code.
- 2003-05-15 Steven Reddie <Steven.Reddie at ca.com>
- * pthread_win32_attach_detach_np.c (pthread_win32_process_detach_np):
- NULLify ptw32_selfThreadKey after the thread is destroyed, otherwise
- destructors calling pthreads routines might resurrect it again, creating
- memory leaks. Call the underlying Win32 Tls routine directly rather than
- pthread_setspecific().
- (pthread_win32_thread_detach_np): Likewise.
- 2003-05-14 Viv <vcotirlea at hotmail.com>
- * pthread.dsp: Change /MT compile flag to /MD.
- 2003-03-04 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Fix failure to
- set ownership of mutex on second grab after abstime timeout.
- - bug reported by Robert Strycek <strycek at posam.sk>
- 2002-12-17 Thomas Pfaff <tpfaff at gmx.net>
- * pthread_mutex_lock.c (ptw32_semwait): New static routine to provide
- a non-cancelable sem_wait() function. This is consistent with the
- way that pthread_mutex_timedlock.c does it.
- (pthread_mutex_lock): Use ptw32_semwait() instead of sem_wait().
- 2002-12-11 Thomas Pfaff <tpfaff at gmx.net>
- * pthread_mutex_trylock.c: Should return EBUSY rather than EDEADLK.
- * pthread_mutex_destroy.c: Remove redundant ownership test (the
- trylock call does this for us); do not destroy a recursively locked
- mutex.
- 2002-09-20 Michael Johnson <michaelj at maine.rr.com>
- * pthread_cond_destroy.c (pthread_cond_destroy):
- When two different threads exist, and one is attempting to
- destroy a condition variable while the other is attempting to
- initialize a condition variable that was created with
- PTHREAD_COND_INITIALIZER, a deadlock can occur. Shrink
- the ptw32_cond_list_lock critical section to fix it.
- 2002-07-31 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * ptw32_threadStart.c (ptw32_threadStart): Thread cancelLock
- destruction moved to ptw32_threadDestroy().
- * ptw32_threadDestroy.c (ptw32_threadDestroy): Destroy
- the thread's cancelLock. Moved here from ptw32_threadStart.c
- to cleanup implicit threads as well.
- 2002-07-30 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * pthread_cond_wait.c (ptw32_cond_wait_cleanup):
- Remove code designed to avoid/prevent spurious wakeup
- problems. It is believed that the sem_timedwait() call
- is consuming a CV signal that it shouldn't and this is
- breaking the avoidance logic.
- 2002-07-30 Ross Johnson <rpj at ise.canberra.edu.au>
- * sem_timedwait.c (sem_timedwait): Tighten checks for
- unreasonable abstime values - that would result in
- unexpected timeout values.
- * w32_CancelableWait.c (ptw32_cancelable_wait):
- Tighten up return value checking and add comments.
- 2002-06-08 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * sem_getvalue.c (sem_getvalue): Now returns a value for the
- NEED_SEM version (i.e. earlier versions of WinCE).
- 2002-06-04 Rob Fanner <rfanner at stonethree.com>
- * sem_getvalue.c (sem_getvalue): The Johnson M. Hart
- approach didn't work - we are forced to take an
- intrusive approach. We try to decrement the sema
- and then immediately release it again to get the
- value. There is a small probability that this may
- block other threads, but only momentarily.
- 2002-06-03 Ross Johnson <rpj at ise.canberra.edu.au>
- * sem_init.c (sem_init): Initialise Win32 semaphores
- to _POSIX_SEM_VALUE_MAX (which this implementation
- defines in pthread.h) so that sem_getvalue() can use
- the trick described in the comments in sem_getvalue().
- * pthread.h (_POSIX_SEM_VALUE_MAX): Defined.
- (_POSIX_SEM_NSEMS_MAX): Defined - not used but may be
- useful for source code portability.
- 2002-06-03 Rob Fanner <rfanner at stonethree.com>
- * sem_getvalue.c (sem_getvalue): Did not work on NT.
- Use approach suggested by Johnson M. Hart in his book
- "Win32 System Programming".
- 2002-02-28 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * errno.c: Compiler directive was incorrectly including code.
- * pthread.h: Conditionally added some #defines from config.h
- needed when not building the library. e.g. NEED_ERRNO, NEED_SEM.
- (PTW32_DLLPORT): Now only defined if _DLL defined.
- (_errno): Compiler directive was incorrectly including prototype.
- * sched.h: Conditionally added some #defines from config.h
- needed when not building the library.
- * semaphore.h: Replace an instance of NEED_SEM that should
- have been NEED_ERRNO. This change currently has nil effect.
- * GNUmakefile: Correct some recent changes.
- * Makefile: Add rule to generate pre-processor output.
- 2002-02-23 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * pthread_rwlock_timedrdlock.c: New - untested.
- * pthread_rwlock_timedwrlock.c: New - untested.
-
- * Testsuite passed (except known MSVC++ problems)
- * pthread_cond_destroy.c: Expand the time change
- critical section to solve deadlock problem.
- * pthread.c: Add all remaining C modules.
- * pthread.h: Use dllexport/dllimport attributes on functions
- to avoid using pthread.def.
- * sched.h: Likewise.
- * semaphore.h: Likewise.
- * GNUmakefile: Add new targets for single translation
- unit build to maximise inlining potential; generate
- pthread.def automatically.
- * Makefile: Likewise, but no longer uses pthread.def.
- 2002-02-20 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * pthread_cond_destroy.c (pthread_cond_destroy):
- Enter the time change critical section earlier.
- 2002-02-17 Ross Johnson <rpj at setup1.ise.canberra.edu.au
- * Testsuite passed.
- * pthread_timechange_handler_np.c: New; following
- a suggestion from Alexander Terekhov that CVs should
- be broadcast so that they all re-evaluate their
- condition variables and reset a new timeout if
- required, whenever an application receives a
- WM_TIMECHANGE message. This message indicates that
- the system time has been changed. Therefore, CVs
- waiting for a timeout set as an abs_time will possibly
- not wake up at the expected time. Some applications
- may not be tolerant of this.
- * pthread_cond_init.c: Add CV to linked list.
- * pthread_cond_destroy.c: Remove CV from linked list.
- * global.c (ptw32_cond_list_head): New variable.
- (ptw32_cond_list_tail): New variable.
- (ptw32_cond_list_cs): New critical section.
- * ptw32_processInitialize (ptw32_cond_list_cs): Initialize.
- * ptw32_processTerminate (ptw32_cond_list_cs): Delete.
- * Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * spin.c: Split file into function segments.
- * ptw32_spinlock_check_need_init.c: Separated routine from spin.c.
- * pthread_spin_init.c: Likewise.
- * pthread_spin_destroy.c: Likewise.
- * pthread_spin_lock.c: Likewise.
- * pthread_spin_unlock.c: Likewise.
- * pthread_spin_trylock.c: Likewise.
- * sync.c: Split file into function segments.
- * pthread_detach.c: Separated routine from sync.c.
- * pthread_join.c: Likewise.
- * tsd.c: Split file into function segments.
- * pthread_key_create.c: Separated routine from tsd.c.
- * pthread_key_delete.c: Likewise.
- * pthread_setspecific.c: Likewise.
- * pthread_getspecific.c: Likewise.
- * sched.c: Split file into function segments.
- * pthread_attr_setschedpolicy.c: Separated routine from sched.c.
- * pthread_attr_getschedpolicy.c: Likewise.
- * pthread_attr_setschedparam.c: Likewise.
- * pthread_attr_getschedparam.c: Likewise.
- * pthread_attr_setinheritsched.c: Likewise.
- * pthread_attr_getinheritsched.c: Likewise.
- * pthread_setschedparam.c: Likewise.
- * pthread_getschedparam.c: Likewise.
- * sched_get_priority_max.c: Likewise.
- * sched_get_priority_min.c: Likewise.
- * sched_setscheduler.c: Likewise.
- * sched_getscheduler.c: Likewise.
- * sched_yield.c: Likewise.
- 2002-02-16 Ross Johnson <rpj at setup1.ise.canberra.edu.au
- Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * mutex.c: Split file into function segments.
- * pthread_mutexattr_destroy.c: Separated routine from mutex.c
- * pthread_mutexattr_getpshared.c: Likewise.
- * pthread_mutexattr_gettype.c: Likewise.
- * pthread_mutexattr_init.c: Likewise.
- * pthread_mutexattr_setpshared.c: Likewise.
- * pthread_mutexattr_settype.c: Likewise.
- * ptw32_mutex_check_need_init.c: Likewise.
- * pthread_mutex_destroy.c: Likewise.
- * pthread_mutex_init.c: Likewise.
- * pthread_mutex_lock.c: Likewise.
- * pthread_mutex_timedlock.c: Likewise.
- * pthread_mutex_trylock.c: Likewise.
- * pthread_mutex_unlock.c: Likewise.
-
- * private.c: Split file into function segments.
- * ptw32_InterlockedCompareExchange.c: Separated routine from private.c
- * ptw32_callUserDestroyRoutines.c: Likewise.
- * ptw32_getprocessors.c: Likewise.
- * ptw32_processInitialize.c: Likewise.
- * ptw32_processTerminate.c: Likewise.
- * ptw32_threadDestroy.c: Likewise.
- * ptw32_threadStart.c: Likewise.
- * ptw32_throw.c: Likewise.
- * ptw32_timespec.c: Likewise.
- * ptw32_tkAssocCreate.c: Likewise.
- * ptw32_tkAssocDestroy.c: Likewise.
- * rwlock.c: Split file into function segments.
- * pthread_rwlockattr_destroy.c: Separated routine from rwlock.c
- * pthread_rwlockattr_getpshared.c: Likewise.
- * pthread_rwlockattr_init.c: Likewise.
- * pthread_rwlockattr_setpshared.c: Likewise.
- * ptw32_rwlock_check_need_init.c: Likewise.
- * pthread_rwlock_destroy.c: Likewise.
- * pthread_rwlock_init.c: Likewise.
- * pthread_rwlock_rdlock.c: Likewise.
- * pthread_rwlock_tryrdlock.c: Likewise.
- * pthread_rwlock_trywrlock.c: Likewise.
- * pthread_rwlock_unlock.c: Likewise.
- * pthread_rwlock_wrlock.c: Likewise.
- 2002-02-10 Ross Johnson <rpj at setup1.ise.canberra.edu.au
- Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * nonportable.c: Split file into function segments.
- * np_delay.c: Separated routine from nonportable.c
- * np_getw32threadhandle.c: Likewise.
- * np_mutexattr_setkind.c: Likewise.
- * np_mutexattr_getkind.c: Likewise.
- * np_num_processors.c: Likewise.
- * np_win32_attach_detach.c: Likewise.
- * misc.c: Split file into function segments.
- * pthread_equal.c: Separated routine from nonportable.c.
- * pthread_getconcurrency.c: Likewise.
- * pthread_once.c: Likewise.
- * pthread_self.c: Likewise.
- * pthread_setconcurrency.c: Likewise.
- * ptw32_calloc.c: Likewise.
- * ptw32_new.c: Likewise.
- * w32_CancelableWait.c: Likewise.
-
- 2002-02-09 Ross Johnson <rpj at setup1.ise.canberra.edu.au
- Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * condvar.c: Split file into function segments.
- * pthread_condattr_destroy.c: Separated routine from condvar.c.
- * pthread_condattr_getpshared.c: Likewise.
- * pthread_condattr_init.c: Likewise.
- * pthread_condattr_setpshared.c: Likewise.
- * ptw32_cond_check_need_init.c: Likewise.
- * pthread_cond_destroy.c: Likewise.
- * pthread_cond_init.c: Likewise.
- * pthread_cond_signal.c: Likewise.
- * pthread_cond_wait.c: Likewise.
-
- 2002-02-07 Alexander Terekhov<TEREKHOV at de.ibm.com>
- * nonportable.c (pthread_delay_np): Make a true
- cancelation point. Deferred cancels will interrupt the
- wait.
- 2002-02-07 Ross Johnson <rpj at setup1.ise.canberra.edu.au
- * misc.c (ptw32_new): Add creation of cancelEvent so that
- implicit POSIX threads (Win32 threads with a POSIX face)
- are cancelable; mainly so that pthread_delay_np doesn't fail
- if called from the main thread.
- * create.c (pthread_create): Remove creation of cancelEvent
- from here; now in ptw32_new().
- Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * barrier.c: All routines are now in separate compilation units;
- This file is used to congregate the separate modules for
- potential inline optimisation and backward build compatibility.
- * cancel.c: Likewise.
- * pthread_barrierattr_destroy.c: Separated routine from cancel.c.
- * pthread_barrierattr_getpshared.c: Likewise.
- * pthread_barrierattr_init.c: Likewise.
- * pthread_barrierattr_setpshared.c: Likewise.
- * pthread_barrier_destroy.c: Likewise.
- * pthread_barrier_init.c: Likewise.
- * pthread_barrier_wait.c: Likewise.
- * pthread_cancel.c: Likewise.
- * pthread_setcancelstate.c: Likewise.
- * pthread_setcanceltype.c: Likewise.
- * pthread_testcancel.c: Likewise.
- 2002-02-04 Max Woodbury <mtew at cds.duke.edu>
- Reduced name space pollution.
- -----------------------------
- When the appropriate symbols are defined, the headers
- will restrict the definitions of new names. In particular,
- it must be possible to NOT include the <windows.h>
- header and related definitions with some combination
- of symbol definitions. Secondly, it should be possible
- that additional definitions should be limited to POSIX
- compliant symbols by the definition of appropriate symbols.
- * pthread.h: POSIX conditionals.
- * sched.h: POSIX conditionals.
- * semaphore.h: POSIX conditionals.
- * semaphore.c: Included <limits.h>.
- (sem_init): Changed magic 0x7FFFFFFFL to INT_MAX.
- (sem_getvalue): Trial version.
- Reduce executable size.
- -----------------------
- When linking with the static library, only those
- routines actually called, either directly or indirectly
- should be included.
- [Gcc has the -ffunction-segments option to do this but MSVC
- doesn't have this feature as far as I can determine. Other
- compilers are undetermined as well. - rpj]
- * semaphore.c: All routines are now in separate compilation units;
- This file is used to congregate the separate modules for
- potential inline optimisation and backward build compatibility.
- * sem_close.c: Separated routine from semaphore.c.
- * ptw32_decrease_semaphore.c: Likewise.
- * sem_destroy.c: Likewise.
- * sem_getvalue.c: Likewise.
- * ptw32_increase_semaphore.c: Likewise.
- * sem_init.c: Likewise.
- * sem_open.c: Likewise.
- * sem_post.c: Likewise.
- * sem_post_multiple.c: Likewise.
- * sem_timedwait.c: Likewise.
- * sem_trywait.c: Likewise.
- * sem_unlink.c: Likewise.
- * sem_wait.c: Likewise.
- 2002-02-04 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- The following extends the idea above to the rest of pthreads-win32 - rpj
-
- * attr.c: All routines are now in separate compilation units;
- This file is used to congregate the separate modules for
- potential inline optimisation and backward build compatibility.
- * pthread_attr_destroy.c: Separated routine from attr.c.
- * pthread_attr_getdetachstate.c: Likewise.
- * pthread_attr_getscope.c: Likewise.
- * pthread_attr_getstackaddr.c: Likewise.
- * pthread_attr_getstacksize.c: Likewise.
- * pthread_attr_init.c: Likewise.
- * pthread_attr_is_attr.c: Likewise.
- * pthread_attr_setdetachstate.c: Likewise.
- * pthread_attr_setscope.c: Likewise.
- * pthread_attr_setstackaddr.c: Likewise.
- * pthread_attr_setstacksize.c: Likewise.
- * pthread.c: Agregation of agregate modules for super-inlineability.
- 2002-02-02 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * cancel.c: Rearranged some code and introduced checks
- to disable cancelation at the start of a thread's cancelation
- run to prevent double cancelation. The main problem
- arises if a thread is canceling and then receives a subsequent
- async cancel request.
- * private.c: Likewise.
- * condvar.c: Place pragmas around cleanup_push/pop to turn
- off inline optimisation (/Obn where n>0 - MSVC only). Various
- optimisation switches in MSVC turn this on, which interferes with
- the way that cleanup handlers are run in C++ EH and SEH
- code. Application code compiled with inline optimisation must
- also wrap cleanup_push/pop blocks with the pragmas, e.g.
- #pragma inline_depth(0)
- pthread_cleanup_push(...)
- ...
- pthread_cleanup_pop(...)
- #pragma inline_depth(8)
- * rwlock.c: Likewise.
- * mutex.c: Remove attempts to inline some functions.
- * signal.c: Modify misleading comment.
- 2002-02-01 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * semaphore.c (sem_trywait): Fix missing errno return
- for systems that define NEED_SEM (e.g. early WinCE).
- * mutex.c (pthread_mutex_timedlock): Return ENOTSUP
- for systems that define NEED_SEM since they don't
- have sem_trywait().
- 2002-01-27 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * mutex.c (pthread_mutex_timedlock): New function suggested by
- Alexander Terekhov. The logic required to implement this
- properly came from Alexander, with some collaboration
- with Thomas Pfaff.
- (pthread_mutex_unlock): Wrap the waiters check and sema
- post in a critical section to prevent a race with
- pthread_mutex_timedlock.
- (ptw32_timed_semwait): New function;
- returns a special result if the absolute timeout parameter
- represents a time already passed when called; used by
- pthread_mutex_timedwait(). Have deliberately not reused
- the name "ptw32_sem_timedwait" because they are not the same
- routine.
- * condvar.c (ptw32_cond_timedwait): Use the new sem_timedwait()
- instead of ptw32_sem_timedwait(), which now has a different
- function. See previous.
- * implement.h: Remove prototype for ptw32_sem_timedwait.
- See next.
- (pthread_mutex_t_): Add critical section element for access
- to lock_idx during mutex post-timeout processing.
- * semaphore.h (sem_timedwait): See next.
- * semaphore.c (sem_timedwait): See next.
- * private.c (ptw32_sem_timedwait): Move to semaphore.c
- and rename as sem_timedwait().
- 2002-01-18 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * sync.c (pthread_join): Was getting the exit code from the
- calling thread rather than the joined thread if
- defined(__MINGW32__) && !defined(__MSVCRT__).
- 2002-01-15 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h: Unless the build explicitly defines __CLEANUP_SEH,
- __CLEANUP_CXX, or __CLEANUP_C, then the build defaults to
- __CLEANUP_C style cleanup. This style uses setjmp/longjmp
- in the cancelation and thread exit implementations and therefore
- won't do stack unwinding if linked to applications that have it
- (e.g. C++ apps). This is currently consistent with most/all
- commercial Unix POSIX threads implementations.
- * spin.c (pthread_spin_init): Edit renamed function call.
- * nonportable.c (pthread_num_processors_np): New.
- (pthread_getprocessors_np): Renamed to ptw32_getprocessors
- and moved to private.c.
- * private.c (pthread_getprocessors): Moved here from
- nonportable.c.
- * pthread.def (pthread_getprocessors_np): Removed
- from export list.
- * rwlock.c (pthread_rwlockattr_init): New.
- (pthread_rwlockattr_destroy): New.
- (pthread_rwlockattr_getpshared): New.
- (pthread_rwlockattr_setpshared): New.
- 2002-01-14 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * attr.c (pthread_attr_setscope): Fix struct pointer
- indirection error introduced 2002-01-04.
- (pthread_attr_getscope): Likewise.
- 2002-01-12 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.dsp (SOURCE): Add missing source files.
- 2002-01-08 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * mutex.c (pthread_mutex_trylock): use
- ptw32_interlocked_compare_exchange function pointer
- rather than ptw32_InterlockedCompareExchange() directly
- to retain portability to non-iX86 processors,
- e.g. WinCE etc. The pointer will point to the native
- OS version of InterlockedCompareExchange() if the
- OS supports it (see ChangeLog entry of 2001-10-17).
- 2002-01-07 Thomas Pfaff <tpfaff at gmx.net>, Alexander Terekhov <TEREKHOV at de.ibm.com>
- * mutex.c (pthread_mutex_init): Remove critical
- section calls.
- (pthread_mutex_destroy): Likewise.
- (pthread_mutex_unlock): Likewise.
- (pthread_mutex_trylock): Likewise; uses
- ptw32_InterlockedCompareExchange() to avoid need for
- critical section; library is no longer i386 compatible;
- recursive mutexes now increment the lock count rather
- than return EBUSY; errorcheck mutexes return EDEADLCK
- rather than EBUSY. This behaviour is consistent with the
- Solaris pthreads implementation.
- * implement.h (pthread_mutex_t_): Remove critical
- section element - no longer needed.
-
- 2002-01-04 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * attr.c (pthread_attr_setscope): Add more error
- checking and actually store the scope value even
- though it's not really necessary.
- (pthread_attr_getscope): Return stored value.
- * implement.h (pthread_attr_t_): Add new scope element.
- * ANNOUNCE: Fix out of date comment next to
- pthread_attr_setscope in conformance section.
- 2001-12-21 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * mutex.c (pthread_mutex_lock): Decrementing lock_idx was
- not thread-safe.
- (pthread_mutex_trylock): Likewise.
- 2001-10-26 prionx@juno.com
- * semaphore.c (sem_init): Fix typo and missing bracket
- in conditionally compiled code. Only older versions of
- WinCE require this code, hence it doesn't normally get
- tested; somehow when sem_t reverted to an opaque struct
- the calloc NULL check was left in the conditionally included
- section.
- (sem_destroy): Likewise, the calloced sem_t wasn't being freed.
- 2001-10-25 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * GNUmakefile (libwsock32): Add to linker flags for
- WSAGetLastError() and WSASetLastError().
- * Makefile (wsock32.lib): Likewise.
- * create.c: Minor mostly inert changes.
- * implement.h (PTW32_MAX): Move into here and renamed
- from sched.h.
- (PTW32_MIN): Likewise.
- * GNUmakefile (TEST_ICE): Define if testing internal
- implementation of InterlockedCompareExchange.
- * Makefile (TEST_ICE): Likewise.
- * private.c (TEST_ICE): Likewise.
-
- 2001-10-24 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * attr.c (pthread_attr_setstacksize): Quell warning
- from LCC by conditionally compiling the stacksize
- validity check. LCC correctly warns that the condition
- (stacksize < PTHREAD_STACK_MIN) is suspicious
- because STACK_MIN is 0 and stacksize is of type
- size_t (or unsigned int).
- 2001-10-17 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Move _LONG and _LPLONG defines into
- implement.h; rename to PTW32_INTERLOCKED_LONG and
- PTW32_INTERLOCKED_LPLONG respectively.
- * spin.c: Likewise; ptw32_interlocked_compare_exchange used
- in place of InterlockedCompareExchange directly.
- * global.c (ptw32_interlocked_compare_exchange): Add
- prototype for this new routine pointer to be used when
- InterlockedCompareExchange isn't supported by Windows.
- * nonportable.c (pthread_win32_process_attach_np): Check for
- support of InterlockedCompareExchange in kernel32 and assign its
- address to ptw32_interlocked_compare_exchange if it exists, or
- our own ix86 specific implementation ptw32_InterlockedCompareExchange.
- *private.c (ptw32_InterlockedCompareExchange): An
- implementation of InterlockedCompareExchange() which is
- specific to ix86; written directly in assembler for either
- MSVC or GNU C; needed because Windows 95 doesn't support
- InterlockedCompareExchange().
- * sched.c (sched_get_priority_min): Extend to return
- THREAD_PRIORITY_IDLE.
- (sched_get_priority_max): Extend to return
- THREAD_PRIORITY_CRITICAL.
- 2001-10-15 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * spin.c (pthread_spin_lock): PTHREAD_SPINLOCK_INITIALIZER
- was causing a program fault.
- (pthread_spin_init): Could have alloced memory
- without freeing under some error conditions.
- * mutex.c (pthread_mutex_init): Move memory
- allocation of mutex struct after checking for
- PROCESS_SHARED.
- 2001-10-12 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * spin.c (pthread_spin_unlock): Was not returning
- EPERM if the spinlock was not locked, for multi CPU
- machines.
- 2001-10-08 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * spin.c (pthread_spin_trylock): Was not returning
- EBUSY for multi CPU machines.
- 2001-08-24 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * condvar.c (pthread_cond_destroy): Remove cv element
- that is no longer used.
- * implement.h: Likewise.
- 2001-08-23 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * condvar.c (pthread_cond_destroy): fix bug with
- respect to deadlock in the case of concurrent
- _destroy/_unblock; a condition variable can be destroyed
- immediately after all the threads that are blocked on
- it are awakened.
- 2001-08-23 Phil Frisbie, Jr. <phil at hawksoft.com>
- * tsd.c (pthread_getspecific): Preserve the last
- winsock error [from WSAGetLastError()].
- 2001-07-18 Scott McCaskill <scott at magruder.org>
- * mutex.c (pthread_mutexattr_init): Return ENOMEM
- immediately and don't dereference the NULL pointer
- if calloc fails.
- (pthread_mutexattr_getpshared): Don't dereference
- a pointer that is possibly NULL.
- * barrier.c (pthread_barrierattr_init): Likewise
- (pthread_barrierattr_getpshared): Don't dereference
- a pointer that is possibly NULL.
- * condvar.c (pthread_condattr_getpshared): Don't dereference
- a pointer that is possibly NULL.
- 2001-07-15 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * rwlock.c (pthread_rwlock_wrlock): Is allowed to be
- a cancelation point; re-enable deferred cancelability
- around the CV call.
- 2001-07-10 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Still more revamping. The exclusive access
- mutex isn't really needed so it has been removed and replaced
- by an InterlockedDecrement(). nSerial has been removed.
- iStep is now dual-purpose. The process shared attribute
- is now stored in the barrier struct.
- * implement.h (pthread_barrier_t_): Lost some/gained one
- elements.
- * private.c (ptw32_threadStart): Removed some comments.
- 2001-07-10 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Revamped to fix the race condition. Two alternating
- semaphores are used instead of the PulseEvent. Also improved
- overall throughput by returning PTHREAD_BARRIER_SERIAL_THREAD
- to the first waking thread.
- * implement.h (pthread_barrier_t_): Revamped.
- 2001-07-09 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Fix several bugs in all routines. Now passes
- tests/barrier5.c which is fairly rigorous. There is still
- a non-optimal work-around for a race condition between
- the barrier breeched event signal and event wait. Basically
- the last (signalling) thread to hit the barrier yields
- to allow any other threads, which may have lost the race,
- to complete.
- 2001-07-07 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Changed synchronisation mechanism to a
- Win32 manual reset Event and use PulseEvent to signal
- waiting threads. If the implementation continued to use
- a semaphore it would require a second semaphore and
- some management to use them alternately as barriers. A
- single semaphore allows threads to cascade from one barrier
- through the next, leaving some threads blocked at the first.
- * implement.h (pthread_barrier_t_): As per above.
- * general: Made a number of other routines inlinable.
- 2001-07-07 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * spin.c: Revamped and working; included static initialiser.
- Now beta level.
- * barrier.c: Likewise.
- * condvar.c: Macro constant change; inline auto init routine.
- * mutex.c: Likewise.
- * rwlock.c: Likewise.
- * private.c: Add support for spinlock initialiser.
- * global.c: Likewise.
- * implement.h: Likewise.
- * pthread.h (PTHREAD_SPINLOCK_INITIALIZER): Fix typo.
- 2001-07-05 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * barrier.c: Remove static initialisation - irrelevent
- for this object.
- * pthread.h (PTHREAD_BARRIER_INITIALIZER): Removed.
- * rwlock.c (pthread_rwlock_wrlock): This routine is
- not a cancelation point - disable deferred
- cancelation around call to pthread_cond_wait().
- 2001-07-05 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * spin.c: New module implementing spin locks.
- * barrier.c: New module implementing barriers.
- * pthread.h (_POSIX_SPIN_LOCKS): defined.
- (_POSIX_BARRIERS): Defined.
- (pthread_spin_*): Defined.
- (pthread_barrier*): Defined.
- (PTHREAD_BARRIER_SERIAL_THREAD): Defined.
- * implement.h (pthread_spinlock_t_): Defined.
- (pthread_barrier_t_): Defined.
- (pthread_barrierattr_t_): Defined.
- * mutex.c (pthread_mutex_lock): Return with the error
- if an auto-initialiser initialisation fails.
- * nonportable.c (pthread_getprocessors_np): New; gets the
- number of available processors for the current process.
- 2001-07-03 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * pthread.h (_POSIX_READER_WRITER_LOCKS): Define it
- if not already defined.
- 2001-07-01 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * condvar.c: Fixed lost signal bug reported by Timur Aydin
- (taydin@snet.net).
- [RPJ (me) didn't translate the original algorithm
- correctly.]
- * semaphore.c: Added sem_post_multiple; this is a useful
- routine, but it doesn't appear to be standard. For now it's
- not an exported function.
-
- 2001-06-25 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * create.c (pthread_create): Add priority inheritance
- attributes.
- * mutex.c (pthread_mutex_lock): Remove some overhead for
- PTHREAD_MUTEX_NORMAL mutex types. Specifically, avoid
- calling pthread_self() and pthread_equal() to check/set
- the mutex owner. Introduce a new pseudo owner for this
- type. Test results suggest increases in speed of up to
- 90% for non-blocking locks.
- This is the default type of mutex used internally by other
- synchronising objects, ie. condition variables and
- read-write locks. The test rwlock7.c shows about a
- 30-35% speed increase over snapshot 2001-06-06. The
- price of this is that the application developer
- must ensure correct behaviour, or explicitly set the
- mutex to a safer type such as PTHREAD_MUTEX_ERRORCHECK.
- For example, PTHREAD_MUTEX_NORMAL (or PTHREAD_MUTEX_DEFAULT)
- type mutexes will not return an error if a thread which is not
- the owner calls pthread_mutex_unlock. The call will succeed
- in unlocking the mutex if it is currently locked, but a
- subsequent unlock by the true owner will then fail with EPERM.
- This is however consistent with some other implementations.
- (pthread_mutex_unlock): Likewise.
- (pthread_mutex_trylock): Likewise.
- (pthread_mutex_destroy): Likewise.
- * attr.c (pthread_attr_init): PTHREAD_EXPLICIT_SCHED is the
- default inheritance attribute; THREAD_PRIORITY_NORMAL is
- the default priority for new threads.
- * sched.c (pthread_attr_setschedpolicy): Added routine.
- (pthread_attr_getschedpolicy): Added routine.
- (pthread_attr_setinheritsched): Added routine.
- (pthread_attr_getinheritsched): Added routine.
- * pthread.h (sched_rr_set_interval): Added as a macro;
- returns -1 with errno set to ENOSYS.
- 2001-06-23 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- *sched.c (pthread_attr_setschedparam): Add priority range
- check.
- (sched_setscheduler): New function; checks for a valid
- pid and policy; checks for permission to set information
- in the target process; expects pid to be a Win32 process ID,
- not a process handle; the only scheduler policy allowed is
- SCHED_OTHER.
- (sched_getscheduler): Likewise, but checks for permission
- to query.
- * pthread.h (SCHED_*): Moved to sched.h as defined in the
- POSIX standard.
- * sched.h (SCHED_*): Moved from pthread.h.
- (pid_t): Defined if necessary.
- (sched_setscheduler): Defined.
- (sched_getscheduler): Defined.
- * pthread.def (sched_setscheduler): Exported.
- (sched_getscheduler): Likewise.
- 2001-06-23 Ralf Brese <Ralf.Brese at pdb4.siemens.de>
- * create.c (pthread_create): Set thread priority from
- thread attributes.
- 2001-06-18 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * Made organisational-only changes to UWIN additions.
- * dll.c (dllMain): Moved UWIN process attach code
- to pthread_win32_process_attach_np(); moved
- instance of pthread_count to global.c.
- * global.c (pthread_count): Moved from dll.c.
- * nonportable.c (pthread_win32_process_attach_np):
- Moved _UWIN code to here from dll.c.
- * implement.h (pthread_count): Define extern int.
- * create.c (pthread_count): Remove extern int.
- * private.c (pthread_count): Likewise.
- * exit.c (pthread_count): Likewise.
- 2001-06-18 David Korn <dgk at research.att.com>
- * dll.c: Added changes necessary to work with UWIN.
- * create.c: Likewise.
- * pthread.h: Likewise.
- * misc.c: Likewise.
- * exit.c: Likewise.
- * private.c: Likewise.
- * implement.h: Likewise.
- There is some room at the start of struct pthread_t_
- to implement the signal semantics in UWIN's posix.dll
- although this is not yet complete.
- * Nmakefile: Compatible with UWIN's Nmake utility.
- * Nmakefile.tests: Likewise - for running the tests.
- 2001-06-08 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * semaphore.h (sem_t): Fixed for compile and test.
- * implement.h (sem_t_): Likewise.
- * semaphore.c: Likewise.
- * private.c (ptw32_sem_timedwait): Updated to use new
- opaque sem_t.
- 2001-06-06 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * semaphore.h (sem_t): Is now an opaque pointer;
- moved actual definition to implement.h.
- * implement.h (sem_t_): Move here from semaphore.h;
- was the definition of sem_t.
- * semaphore.c: Wherever necessary, changed use of sem
- from that of a pointer to a pointer-pointer; added
- extra checks for a valid sem_t; NULL sem_t when
- it is destroyed; added extra checks when creating
- and destroying sem_t elements in the NEED_SEM
- code branches; changed from using a pthread_mutex_t
- ((*sem)->mutex) to CRITICAL_SECTION ((*sem)->sem_lock_cs)
- in NEED_SEM branches for access serialisation.
- 2001-06-06 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * mutex.c (pthread_mutexattr_init): Remove
- ptw32_mutex_default_kind.
-
- 2001-06-05 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * nonportable.c (pthread_mutex_setdefaultkind_np):
- Remove - should not have been included in the first place.
- (pthread_mutex_getdefaultkind_np): Likewise.
- * global.c (ptw32_mutex_default_kind): Likewise.
- * mutex.c (pthread_mutex_init): Remove use of
- ptw32_mutex_default_kind.
- * pthread.h (pthread_mutex_setdefaultkind_np): Likewise.
- (pthread_mutex_getdefaultkind_np): Likewise.
- * pthread.def (pthread_mutexattr_setkind_np): Added.
- (pthread_mutexattr_getkind_np): Likewise.
- * README: Many changes that should have gone in before
- the last snapshot.
- * README.NONPORTABLE: New - referred to by ANNOUNCE
- but never created; documents the non-portable routines
- included in the library - moved from README with new
- routines added.
- * ANNOUNCE (pthread_mutexattr_setkind_np): Added to
- compliance list.
- (pthread_mutexattr_getkind_np): Likewise.
- 2001-06-04 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * condvar.c: Add original description of the algorithm as
- developed by Terekhov and Thomas, plus reference to
- README.CV.
- 2001-06-03 Alexander Terekhov <TEREKHOV at de.ibm.com>, Louis Thomas <lthomas at arbitrade.com>
- * condvar.c (pthread_cond_init): Completely revamped.
- (pthread_cond_destroy): Likewise.
- (ptw32_cond_wait_cleanup): Likewise.
- (ptw32_cond_timedwait): Likewise.
- (ptw32_cond_unblock): New general signaling routine.
- (pthread_cond_signal): Now calls ptw32_cond_unblock.
- (pthread_cond_broadcast): Likewise.
- * implement.h (pthread_cond_t_): Revamped.
- * README.CV: New; explanation of the above changes.
- 2001-05-30 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * pthread.h (rand_r): Fake using _seed argument to quell
- compiler warning (compiler should optimise this away later).
- * GNUmakefile (OPT): Leave symbolic information out of the library
- and increase optimisation level - for smaller faster prebuilt
- dlls.
-
- 2001-05-29 Milan Gardian <Milan.Gardian at LEIBINGER.com>
- * Makefile: fix typo.
- * pthreads.h: Fix problems with stdcall/cdecl conventions, in particular
- remove the need for PT_STDCALL everywhere; remove warning supression.
- * (errno): Fix the longstanding "inconsistent dll linkage" problem
- with errno; now also works with /MD debugging libs -
- warnings emerged when compiling pthreads library with /MD (or /MDd)
- compiler switch, instead of /MT (or /MTd) (i.e. when compiling pthreads
- using Multithreaded DLL CRT instead of Multithreaded statically linked
- CRT).
- * create.c (pthread_create): Likewise; fix typo.
- * private.c (ptw32_threadStart): Eliminate use of terminate() which doesn't
- throw exceptions.
- * Remove unnecessary #includes from a number of modules -
- [I had to #include malloc.h in implement.h for gcc - rpj].
- 2001-05-29 Thomas Pfaff <tpfaff at gmx.net>
- * pthread.h (PTHREAD_MUTEX_DEFAULT): New; equivalent to
- PTHREAD_MUTEX_DEFAULT_NP.
- * (PTHREAD_MUTEX_NORMAL): Similarly.
- * (PTHREAD_MUTEX_ERRORCHECK): Similarly.
- * (PTHREAD_MUTEX_RECURSIVE): Similarly.
- * (pthread_mutex_setdefaultkind_np): New; Linux compatibility stub
- for pthread_mutexattr_settype.
- * (pthread_mutexattr_getkind_np): New; Linux compatibility stub
- for pthread_mutexattr_gettype.
- * mutex.c (pthread_mutexattr_settype): New; allow
- the following types of mutex:
- PTHREAD_MUTEX_DEFAULT_NP
- PTHREAD_MUTEX_NORMAL_NP
- PTHREAD_MUTEX_ERRORCHECK_NP
- PTHREAD_MUTEX_RECURSIVE_NP
- * Note that PTHREAD_MUTEX_DEFAULT is equivalent to
- PTHREAD_MUTEX_NORMAL - ie. mutexes should no longer
- be recursive by default, and a thread will deadlock if it
- tries to relock a mutex it already owns. This is inline with
- other pthreads implementations.
- * (pthread_mutex_lock): Process the lock request
- according to the mutex type.
- * (pthread_mutex_init): Eliminate use of Win32 mutexes as the
- basis of POSIX mutexes - instead, a combination of one critical section
- and one semaphore are used in conjunction with Win32 Interlocked* routines.
- * (pthread_mutex_destroy): Likewise.
- * (pthread_mutex_lock): Likewise.
- * (pthread_mutex_trylock): Likewise.
- * (pthread_mutex_unlock): Likewise.
- * Use longjmp/setjmp to implement cancelation when building the library
- using a C compiler which doesn't support exceptions, e.g. gcc -x c (note
- that gcc -x c++ uses exceptions).
- * Also fixed some of the same typos and eliminated PT_STDCALL as
- Milan Gardian's patches above.
- 2001-02-07 Alexander Terekhov <TEREKHOV at de.ibm.com>
- * rwlock.c: Revamped.
- * implement.h (pthread_rwlock_t_): Redefined.
- This implementation does not have reader/writer starvation problem.
- Rwlock attempts to behave more like a normal mutex with
- races and scheduling policy determining who is more important;
- It also supports recursive locking,
- has less synchronization overhead (no broadcasts at all,
- readers are not blocked on any condition variable) and seem to
- be faster than the current implementation [W98 appears to be
- approximately 15 percent faster at least - on top of speed increase
- from Thomas Pfaff's changes to mutex.c - rpj].
- 2000-12-29 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * Makefile: Back-out "for" loops which don't work.
- * GNUmakefile: Remove the fake.a target; add the "realclean"
- target; don't remove built libs under the "clean" target.
- * config.h: Add a guard against multiple inclusion.
- * semaphore.h: Add some defines from config.h to make
- semaphore.h independent of config.h when building apps.
- * pthread.h (_errno): Back-out previous fix until we know how to
- fix it properly.
- * implement.h (lockCount): Add missing element to pthread_mutex_t_.
- * sync.c (pthread_join): Spelling fix in comment.
- * private.c (ptw32_threadStart): Reset original termination
- function (C++).
- (ptw32_threadStart): Cleanup detached threads early in case
- the library is statically linked.
- (ptw32_callUserDestroyRoutines): Remove [SEH] __try block from
- destructor call so that unhandled exceptions will be passed through
- to the system; call terminate() from [C++] try block for the same
- reason.
- * tsd.c (pthread_getspecific): Add comment.
- * mutex.c (pthread_mutex_init): Initialise new elements in
- pthread_mutex_t.
- (pthread_mutex_unlock): Invert "pthread_equal()" test.
- 2000-12-28 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * semaphore.c (mode_t): Use ifndef HAVE_MODE_T to include definition.
- * config.h.in (HAVE_MODE_T): Added.
- (_UWIN): Start adding defines for the UWIN package.
- * private.c (ptw32_threadStart): Unhandled exceptions are
- now passed through to the system to deal with. This is consistent
- with normal Windows behaviour. C++ applications may use
- set_terminate() to override the default behaviour which is
- to call ptw32_terminate(). Ptw32_terminate() cleans up some
- POSIX thread stuff before calling the system default function
- which calls abort(). The users termination function should conform
- to standard C++ semantics which is to not return. It should
- exit the thread (call pthread_exit()) or exit the application.
- * private.c (ptw32_terminate): Added as the default set_terminate()
- function. It calls the system default function after cleaning up
- some POSIX thread stuff.
- * implement.h (ptw32_try_enter_critical_section): Move
- declaration.
- * global.c (ptw32_try_enter_critical_section): Moved
- from dll.c.
- * dll.c: Move process and thread attach/detach code into
- functions in nonportable.c.
- * nonportable.c (pthread_win32_process_attach_np): Process
- attach code from dll.c is now available to static linked
- applications.
- * nonportable.c (pthread_win32_process_detach_np): Likewise.
- * nonportable.c (pthread_win32_thread_attach_np): Likewise.
- * nonportable.c (pthread_win32_thread_detach_np): Likewise.
- * pthread.h: Add new non-portable prototypes for static
- linked applications.
- * GNUmakefile (OPT): Increase optimisation flag and remove
- debug info flag.
- * pthread.def: Add new non-portable exports for static
- linked applications.
- 2000-12-11 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * FAQ: Update Answer 6 re getting a fully working
- Mingw32 built library.
- 2000-10-10 Steven Reddie <smr at essemer.com.au>
-
- * misc.c (pthread_self): Restore Win32 "last error"
- cleared by TlsGetValue() call in
- pthread_getspecific()
-
- 2000-09-20 Arthur Kantor <akantor at bexusa.com>
-
- * mutex.c (pthread_mutex_lock): Record the owner
- of the mutex. This requires also keeping count of
- recursive locks ourselves rather than leaving it
- to Win32 since we need to know when to NULL the
- thread owner when the mutex is unlocked.
- (pthread_mutex_trylock): Likewise.
- (pthread_mutex_unlock): Check that the calling
- thread owns the mutex, decrement the recursive
- lock count, and NULL the owner if zero. Return
- EPERM if the mutex is owned by another thread.
- * implement.h (pthread_mutex_t_): Add ownerThread
- and lockCount members.
- 2000-09-13 Jef Gearhart <jgearhart at tpssys.com>
- * mutex.c (pthread_mutex_init): Call
- TryEnterCriticalSection through the pointer
- rather than directly so that the dll can load
- on Windows versions that can't resolve the
- function, eg. Windows 95
- 2000-09-09 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h (ctime_r): Fix arg.
- 2000-09-08 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * GNUmakefile(_WIN32_WINNT=0x400): Define in CFLAGS;
- doesn't seem to be needed though.
- * cancel.c (pthread_cancel): Must get "self" through
- calling pthread_self() which will ensure a POSIX thread
- struct is built for non-POSIX threads; return an error
- if this fails
- - Ollie Leahy <ollie at mpt.ie>
- (pthread_setcancelstate): Likewise.
- (pthread_setcanceltype): Likewise.
- * misc.c (ptw32_cancelable_wait): Likewise.
- * private.c (ptw32_tkAssocCreate): Remove unused #if 0
- wrapped code.
- * pthread.h (ptw32_get_exception_services_code):
- Needed to be forward declared unconditionally.
- 2000-09-06 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * cancel.c (pthread_cancel): If called from the main
- thread "self" would be NULL; get "self" via pthread_self()
- instead of directly from TLS so that an implicit
- pthread object is created.
- * misc.c (pthread_equal): Strengthen test for NULLs.
- 2000-09-02 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * condvar.c (ptw32_cond_wait_cleanup): Ensure that all
- waking threads check if they are the last, and notify
- the broadcaster if so - even if an error occurs in the
- waiter.
- * semaphore.c (_decrease_semaphore): Should be
- a call to ptw32_decrease_semaphore.
- (_increase_semaphore): Should be a call to
- ptw32_increase_semaphore.
- * misc.c (ptw32_cancelable_wait): Renamed from
- CancelableWait.
- * rwlock.c (_rwlock_check*): Renamed to
- ptw32_rwlock_check*.
- * mutex.c (_mutex_check*): Renamed to ptw32_mutex_check*.
- * condvar.c (cond_timed*): Renamed to ptw32_cond_timed*.
- (_cond_check*): Renamed to ptw32_cond_check*.
- (cond_wait_cleanup*): Rename to ptw32_cond_wait_cleanup*.
- (ptw32_cond_timedwait): Add comments.
- 2000-08-22 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * private.c (ptw32_throw): Fix exception test;
- move exceptionInformation declaration.
- * tsd.c (pthread_key_create): newkey wrongly declared.
- * pthread.h: Fix comment block.
- 2000-08-18 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * mutex.c (pthread_mutex_destroy): Check that the mutex isn't
- held; invalidate the mutex as early as possible to avoid
- contention; not perfect - FIXME!
- * rwlock.c (pthread_rwlock_init): Remove redundant assignment
- to "rw".
- (pthread_rwlock_destroy): Invalidate the rwlock before
- freeing up any of it's resources - to avoid contention.
- * private.c (ptw32_tkAssocCreate): Change assoc->lock
- to use a dynamically initialised mutex - only consumes
- a W32 mutex or critical section when first used,
- not before.
- * mutex.c (pthread_mutex_init): Remove redundant assignment
- to "mx".
- (pthread_mutexattr_destroy): Set attribute to NULL
- before freeing it's memory - to avoid contention.
- * implement.h (PTW32_EPS_CANCEL/PTW32_EPS_EXIT):
- Must be defined for all compilers - used as generic
- exception selectors by ptw32_throw().
- * Several: Fix typos from scripted edit session
- yesterday.
- * nonportable.c (pthread_mutexattr_setforcecs_np):
- Moved this function from mutex.c.
- (pthread_getw32threadhandle_np): New function to
- return the win32 thread handle that the POSIX
- thread is using.
- * mutex.c (pthread_mutexattr_setforcecs_np):
- Moved to new file "nonportable.c".
- * pthread.h (PTW32_BUILD): Only redefine __except
- and catch compiler keywords if we aren't building
- the library (ie. PTW32_BUILD is not defined) -
- this is safer than defining and then undefining
- if not building the library.
- * implement.h: Remove __except and catch undefines.
- * Makefile (CFLAGS): Define PTW32_BUILD.
- * GNUmakefile (CFLAGS): Define PTW32_BUILD.
- * All appropriate: Change Pthread_exception* to
- ptw32_exception* to be consistent with internal
- identifier naming.
- * private.c (ptw32_throw): New function to provide
- a generic exception throw for all internal
- exceptions and EH schemes.
- (ptw32_threadStart): pthread_exit() value is now
- returned via the thread structure exitStatus
- element.
- * exit.c (pthread_exit): pthread_exit() value is now
- returned via the thread structure exitStatus
- element.
- * cancel.c (ptw32_cancel_self): Now uses ptw32_throw.
- (pthread_setcancelstate): Ditto.
- (pthread_setcanceltype): Ditto.
- (pthread_testcancel): Ditto.
- (pthread_cancel): Ditto.
- * misc.c (CancelableWait): Ditto.
- * exit.c (pthread_exit): Ditto.
- * All applicable: Change PTW32_ prefix to
- PTW32_ prefix to remove leading underscores
- from private library identifiers.
- 2000-08-17 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * All applicable: Change _pthread_ prefix to
- ptw32_ prefix to remove leading underscores
- from private library identifiers (single
- and double leading underscores are reserved in the
- ANSI C standard for compiler implementations).
- * tsd.c (pthread_create_key): Initialise temporary
- key before returning it's address to avoid race
- conditions.
- 2000-08-13 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * errno.c: Add _MD precompile condition; thus far
- had no effect when using /MD compile option but I
- thnk it should be there.
- * exit.c: Add __cplusplus to various #if lines;
- was compiling SEH code even when VC++ had
- C++ compile options.
- * private.c: ditto.
- * create.c (pthread_create): Add PT_STDCALL macro to
- function pointer arg in _beginthread().
- * pthread.h: PT_STDCALL really does need to be defined
- in both this and impliment.h; don't set it to __cdecl
- - this macro is only used to extend function pointer
- casting for functions that will be passed as parameters.
- (~PThreadCleanup): add cast and group expression.
- (_errno): Add _MD compile conditional.
- (PtW32NoCatchWarn): Change pragma message.
- * implement.h: Move and change PT_STDCALL define.
- * need_errno.h: Add _MD to compilation conditional.
- * GNUmakefile: Substantial rewrite for new naming
- convention; set for nil optimisation (turn it up
- when we have a working library build; add target
- "fake.a" to build a libpthreadw32.a from the VC++
- built DLL pthreadVCE.dll.
- * pthread.def (LIBRARY): Don't specify in the .def
- file - it is specified on the linker command line
- since we now use the same .def file for variously
- named .dlls.
- * Makefile: Substantial rewrite for new naming
- convention; default nmake target only issues a
- help message; run nmake with specific target
- corresponding to the EH scheme being used.
- * README: Update information; add naming convention
- explanation.
- * ANNOUNCE: Update information.
- 2000-08-12 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h: Add compile-time message when using
- MSC_VER compiler and C++ EH to warn application
- programmers to use PtW32Catch instead of catch(...)
- if they want cancelation and pthread_exit to work.
- * implement.h: Remove #include <semaphore.h>; we
- use our own local semaphore.h.
- 2000-08-10 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * cleanup.c (pthread_pop_cleanup): Remove _pthread
- prefix from __except and catch keywords; implement.h
- now simply undefines ptw32__except and
- ptw32_catch if defined; VC++ was not textually
- substituting ptw32_catch etc back to catch as
- it was redefined; the reason for using the prefixed
- version was to make it clear that it was not using
- the pthread.h redefined catch keyword.
- * private.c (ptw32_threadStart): Ditto.
- (ptw32_callUserDestroyRoutines): Ditto.
- * implement.h (ptw32__except): Remove #define.
- (ptw32_catch): Remove #define.
- * GNUmakefile (pthread.a): New target to build
- libpthread32.a from pthread.dll using dlltool.
- * buildlib.bat: Duplicate cl commands with args to
- build C++ EH version of pthread.dll; use of .bat
- files is redundant now that nmake compatible
- Makefile is included; used as a kludge only now.
- * Makefile: Localise some macros and fix up the clean:
- target to extend it and work properly.
- * CONTRIBUTORS: Add contributors.
- * ANNOUNCE: Updated.
- * README: Updated.
- 2000-08-06 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h: Remove #warning - VC++ doesn't accept it.
- 2000-08-05 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h (PtW32CatchAll): Add macro. When compiling
- applications using VC++ with C++ EH rather than SEH
- 'PtW32CatchAll' must be used in place of any 'catch( ... )'
- if the application wants pthread cancelation or
- pthread_exit() to work.
- 2000-08-03 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * pthread.h: Add a base class ptw32_exception for
- library internal exceptions and change the "catch"
- re-define macro to use it.
- 2000-08-02 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * GNUmakefile (CFLAGS): Add -mthreads.
- Add new targets to generate cpp and asm output.
- * sync.c (pthread_join): Remove dead code.
- 2000-07-25 Tristan Savatier <tristan at mpegtv.com>
- * sched.c (sched_get_priority_max): Handle different WinCE and
- Win32 priority values together.
- (sched_get_priority_min): Ditto.
- 2000-07-25 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * create.c (pthread_create): Force new threads to wait until
- pthread_create has the new thread's handle; we also retain
- a local copy of the handle for internal use until
- pthread_create returns.
- * private.c (ptw32_threadStart): Initialise ei[].
- (ptw32_threadStart): When beginthread is used to start the
- thread, force waiting until the creator thread had the
- thread handle.
- * cancel.c (ptw32_cancel_thread): Include context switch
- code for defined(_X86_) environments in addition to _M_IX86.
- * rwlock.c (pthread_rwlock_destroy): Assignment changed
- to avoid compiler warning.
- * private.c (ptw32_get_exception_services_code): Cast
- NULL return value to avoid compiler warning.
- * cleanup.c (pthread_pop_cleanup): Initialise "cleanup" variable
- to avoid compiler warnings.
- * misc.c (ptw32_new): Change "new" variable to "t" to avoid
- confusion with the C++ keyword of the same name.
- * condvar.c (cond_wait_cleanup): Initialise lastWaiter variable.
- (cond_timedwait): Remove unused local variables. to avoid
- compiler warnings.
- * dll.c (dllMain): Remove 2000-07-21 change - problem
- appears to be in pthread_create().
- 2000-07-22 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * tsd.c (pthread_key_create): If a destructor was given
- and the pthread_mutex_init failed, then would try to
- reference a NULL pointer (*key); eliminate this section of
- code by using a dynamically initialised mutex
- (PTHREAD_MUTEX_INITIALIZER).
- * tsd.c (pthread_setspecific): Return an error if
- unable to set the value; simplify cryptic conditional.
- * tsd.c (pthread_key_delete): Locking threadsLock relied
- on mutex_lock returning an error if the key has no destructor.
- ThreadsLock is only initialised if the key has a destructor.
- Making this mutex a static could reduce the number of mutexes
- used by an application since it is actually created only at
- first use and it's often destroyed soon after.
-
- 2000-07-22 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * FAQ: Added Q5 and Q6.
- 2000-07-21 David Baggett <dmb at itasoftware.com>
- * dll.c: Include resource leakage work-around. This is a
- partial FIXME which doesn't stop all leakage. The real
- problem needs to be found and fixed.
- 2000-07-21 Ross Johnson <rpj at setup1.ise.canberra.edu.au>
- * create.c (pthread_create): Set threadH to 0 (zero)
- everywhere. Some assignments were using NULL. Maybe
- it should be NULL everywhere - need to check. (I know
- they are nearly always the same thing - but not by
- definition.)
- * misc.c (pthread_self): Try to catch NULL thread handles
- at the point where they might be generated, even though
- they should always be valid at this point.
- * tsd.c (pthread_setspecific): return an error value if
- pthread_self() returns NULL.
- * sync.c (pthread_join): return an error value if
- pthread_self() returns NULL.
- * signal.c (pthread_sigmask): return an error value if
- pthread_self() returns NULL.
- 2000-03-02 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * attr.c (pthread_attr_init): Set default stacksize to zero (0)
- rather than PTHREAD_STACK_MIN even though these are now the same.
- * pthread.h (PTHREAD_STACK_MIN): Lowered to 0.
- 2000-01-28 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * mutex.c (pthread_mutex_init): Free mutex if it has been alloced;
- if critical sections can be used instead of Win32 mutexes, test
- that the critical section works and return an error if not.
- 2000-01-07 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * cleanup.c (pthread_pop_cleanup): Include SEH code only if MSC is not
- compiling as C++.
- (pthread_push_cleanup): Include SEH code only if MSC is not
- compiling as C++.
- * pthread.h: Include SEH code only if MSC is not
- compiling as C++.
- * implement.h: Include SEH code only if MSC is not
- compiling as C++.
- * cancel.c (ptw32_cancel_thread): Add _M_IX86 check.
- (pthread_testcancel): Include SEH code only if MSC is not
- compiling as C++.
- (ptw32_cancel_self): Include SEH code only if MSC is not
- compiling as C++.
- 2000-01-06 Erik Hensema <erik.hensema at group2000.nl>
- * Makefile: Remove inconsistencies in 'cl' args
- 2000-01-04 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * private.c (ptw32_get_exception_services_code): New; returns
- value of EXCEPTION_PTW32_SERVICES.
- (ptw32_processInitialize): Remove initialisation of
- ptw32_exception_services which is no longer needed.
- * pthread.h (ptw32_exception_services): Remove extern.
- (ptw32_get_exception_services_code): Add function prototype;
- use this to return EXCEPTION_PTW32_SERVICES value instead of
- using the ptw32_exception_services variable which I had
- trouble exporting through pthread.def.
- * global.c (ptw32_exception_services): Remove declaration.
- 1999-11-22 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * implement.h: Forward declare ptw32_new();
- * misc.c (ptw32_new): New; alloc and initialise a new pthread_t.
- (pthread_self): New thread struct is generated by new routine
- ptw32_new().
- * create.c (pthread_create): New thread struct is generated
- by new routine ptw32_new().
- 1999-11-21 Ross Johnson <rpj at special.ise.canberra.edu.au>
- * global.c (ptw32_exception_services): Declare new variable.
- * private.c (ptw32_threadStart): Destroy thread's
- cancelLock mutex; make 'catch' and '__except' usageimmune to
- redfinitions in pthread.h.