Code Log

Commit Date  
[6e3ac5] (4.5 kB) by rpj rpj

Replace global Critical Sections with MCS Queue locks

2011-03-10 13:40:16 View
[a3ea0b] (4.5 kB) by rpj rpj

See ChangeLogs: preparing for new release.

2010-06-20 03:31:18 View
[135d6f] (4.5 kB) by rpj rpj

Comments and code style changes

2010-02-15 14:13:58 View
[35dec5] (4.5 kB) by rpj rpj

See ChangeLog

2007-01-06 13:44:39 View
[46ae63] (4.5 kB) by rpj rpj


2005-05-15 15:28:24 View
[7eb9d4] (7.8 kB) by rpj rpj

Copyright year updated

2005-01-01 14:36:17 View
[45bf44] (7.8 kB) by rpj rpj


2004-11-23 01:06:18 View
[91f42a] (7.8 kB) by rpj rpj

Copyright update

2004-11-22 08:28:15 View
[ec8290] (7.8 kB) by rpj rpj

Mutex, semaphore, thread ID, test suite changes - see ChangeLogs

2004-11-03 01:08:41 View
[531ca4] (7.7 kB) by rpj rpj

Clarify behaviour and remove some redundant code - see ChangeLogs

2004-09-13 04:32:16 View
[1660c9] (4.8 kB) by rpj rpj

Initial support for Digital Mars Compiler

2004-07-01 07:32:10 View
[771465] (4.8 kB) by rpj rpj

re-indentation, bug fixes, hooks for pre-emptive async cancelation

2004-05-17 01:38:02 View
[de906e] (4.8 kB) by rpj rpj

Updated Copyright notice (date and contact address).

2003-08-19 03:31:50 View
[a50745] (4.8 kB) by rpj rpj

Reuse of thread IDs, improved thread ID validation, new tests, bug fixes.

2003-08-14 08:53:17 View
[a416ab] (4.5 kB) by rpj rpj

Major reorganisation of source code; new routine and tests added.

2002-02-18 03:16:52 View
[b29903] (None) by rpj rpj

Copyright notice updates; module splitting; POSIX version
conditional compilation; refinements; bug fixes. See the ChangeLog.

2002-02-08 01:51:17 View
[75f8ad] (None) by rpj rpj

2002-01-27 Ross Johnson <>

* 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
(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
* 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 <>

* 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 <>

* 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
* 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-31 06:56:03 View
[f3cbc4] (None) by rpj rpj

Include an interim complete Copyright notice in each source file;
Remove unused autoconf files;
Add the file COPYING, which describes the pthread-win32 license
relative to the FSF LGPL.

2001-12-18 07:38:07 View
[0c2cb3] (None) by rpj rpj

2000-12-29 Ross Johnson <>

* 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

* tsd.c (pthread_getspecific): Add comment.

* mutex.c (pthread_mutex_init): Initialise new elements in
(pthread_mutex_unlock): Invert "pthread_equal()" test.

2000-12-28 Ross Johnson <>

* semaphore.c (mode_t): Use ifndef HAVE_MODE_T to include definition.

* (HAVE_MODE_T): Added.
(_UWIN): Start adding defines for the UWIN package.

2000-12-29 Ross Johnson <>

* GNUmakefile: Add mutex4 test; ensure libpthreadw32.a is
removed for "clean" target.
* Makefile: Add mutex4 test.

* exception3.c: Remove SEH code; automatically pass the test
under SEH (which is an N/A environment).

* mutex4.c: New test.

* eyal1.c (do_work_unit): Add a dummy "if" to force the
optimiser to retain code; reduce thread work loads.

* condvar8.c (main): Add an additional "assert" for debugging;
increase pthread_cond_signal timeout.

2000-12-29 07:08:44 View
[a366b6] (None) by rpj rpj

2000-08-17 Ross Johnson <>

* 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).

2000-08-17 10:18:36 View
[6eb5bb] (None) by rpj rpj

2000-08-06 Ross Johnson <>

* pthread.h: Remove #warning - VC++ doesn't accept it.

2000-08-05 Ross Johnson <>

* 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 <>

* pthread.h: Add a base class Pthread_exception for
library internal exceptions and change the "catch"
re-define macro to use it.

2000-08-02 Ross Johnson <>

* GNUmakefile (CFLAGS): Add -mthreads.
Add new targets to generate cpp and asm output.

* sync.c (pthread_join): Remove dead code.


2000-08-06 Ross Johnson <>

* ccl.bat: Add /nologo to remove extraneous output.

* exception1.c (exceptionedThread): Init 'dummy';
put expression into if condition to prevent optimising away;
remove unused variable.

* cancel4.c (mythread): Cast return value to avoid warnings.

* cancel2.c (mythread): Missing #endif.

* condvar9.c (mythread): Cast return value to avoid warnings.

* condvar8.c (mythread): Cast return value to avoid warnings.

* condvar7.c (mythread): Cast return value to avoid warnings.

* cleanup3.c (mythread): Cast return value to avoid warnings.

* cleanup2.c (mythread): Cast return value to avoid warnings.

* cleanup1.c (mythread): Cast return value to avoid warnings.

* condvar5.c (mythread): Cast return value to avoid warnings.

* condvar3.c (mythread): Cast return value to avoid warnings.

* condvar6.c (mythread): Cast return value to avoid warnings.

* condvar4.c (mythread): Cast return value to avoid warnings.

2000-08-05 Ross Johnson <>

* cancel2.c: Use PtW32CatchAll macro if defined.

* exception1.c: Use PtW32CatchAll macro if defined.

2000-08-02 Ross Johnson <>

* tsd1.c: Fix typecasts of &result [g++ is now very fussy].

* test.h (assert): Return 0's explicitly to allay
g++ errors.

* join2.c: Add explicit typecasts.

* join1.c: Add explicit typecasts.

* join0.c: Add explicit typecasts.

* eyal1.c: Add explicit typecasts.

* count1.c (main): Add type cast to remove g++ parse warning
[gcc-2.95.2 seems to have tightened up on this].

* Makefile (GLANG): Use c++ explicitly.
Remove MSVC sections (was commented out).
Add target to generate cpp output.

2000-08-06 12:15:47 View
[b035ed] (None) by rpj rpj

2000-07-25 Ross Johnson <>

* dll.c (dllMain): Remove 2000-07-21 change - problem
appears to be in pthread_create().

2000-07-21 Ross Johnson <>

* 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

* 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.
- "David Baggett" <>

* 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-07-25 11:27:23 View
[a378d9] (None) by rpj rpj

Main changes (see ChangeLog diff for details and attributions):-
- asynchronous cancellation added
- attempt to hide internal exceptions from applications
- kernel32 load/free problem fixed
- new tests
- changes only to comments in some tests

2000-01-04 10:19:28 View
[5e87a0] (None) by rpj rpj

1999-08-19 Ross Johnson <>

* private.c (_pthread_threadStart): Return exit status from
the application thread startup routine.
- Milan Gardian <>

1999-08-18 Ross Johnson <>

* exit.c (pthread_exit): Put status into pthread_t->exitStatus
- John Bossom <>
* private.c (_pthread_threadStart): Set pthread->exitStatus
on exit of try{} block.
- John Bossom <>
* sync.c (pthread_join): use pthread_exitStatus value if the
thread exit doesn't return a value (for Mingw32 CRTDLL
which uses endthread instead of _endthreadex).
- John Bossom <>

Tue Aug 17 20:17:58 CDT 1999 Mumit Khan <>

* create.c (pthread_create): Add CRTDLL suppport.
* exit.c (pthread_exit): Likewise.
* private.c (_pthread_threadStart): Likewise.
(_pthread_threadDestroy): Likewise.
* sync.c (pthread_join): Likewise.
* tests/join1.c (main): Warn about partial support for CRTDLL.

Tue Aug 17 20:00:08 1999 Mumit Khan <>

* (LD): Delete entry point.
* acconfig.h (STDCALL): Delete unused macro.
* Remove test for STDCALL.
* Regenerate.
* errno.c (_errno): Fix self type.
* pthread.h (PT_STDCALL): Move from here to
* implement.h (PT_STDCALL): here.
(_pthread_threadStart): Fix prototype.
* private.c (_pthread_threadStart): Likewise.

1999-08-14 Ross Johnson <>

* exit.c (pthread_exit): Don't call pthread_self() but
get thread handle directly from TSD for efficiency.

1999-08-19 05:26:02 View
[747736] (None) by rpj rpj

Wed Apr 7 09:37:00 1999 Ross Johnson <>
* *.c (comments): Remove individual attributions - these are
documented sufficiently elsewhere.
* implement.h (pthread.h): Remove extraneous include.

1999-04-06 17:57:46 View
Older >