Code Log

Commit Date  
[117017] (2.5 kB) by rpj rpj

fix EOL chars in file

2011-03-01 22:49:04 View
[0c4e97] (2.6 kB) by rpj rpj

Fix comment

2011-02-10 00:40:53 View
[7eb9d4] (2.5 kB) by rpj rpj

Copyright year updated

2005-01-01 14:36:17 View
[91f42a] (2.5 kB) by rpj rpj

Copyright update

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

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

2004-11-03 01:08:41 View
[771465] (2.5 kB) by rpj rpj

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

2004-05-17 01:38:02 View
[3c5487] (2.5 kB) by rpj rpj

Remove redundant equality logic.

2004-02-13 06:20:43 View
[de906e] (2.5 kB) by rpj rpj

Updated Copyright notice (date and contact address).

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

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

2003-08-14 08:53:17 View
[e6f179] (2.5 kB) by rpj rpj

Splitting files. See ChangeLog file for details.

2002-02-11 01:53:22 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
[4a7243] (None) by rpj rpj

* 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)
#pragma inline_depth(8)
* rwlock.c: Likewise.
* mutex.c: Remove attempts to inline some functions.
* signal.c: Modify misleading comment.

* mutex8: New test.
* mutex8n: New test.
* mutex8e: New test.
* mutex8r: New test.
* cancel6a: New test.
* cancel6d: New test.
* cleanup0.c: Add pragmas for inline optimisation control.
* cleanup1.c: Add pragmas for inline optimisation control.
* cleanup2.c: Add pragmas for inline optimisation control.
* cleanup3.c: Add pragmas for inline optimisation control.
* condvar7.c: Add pragmas for inline optimisation control.
* condvar8.c: Add pragmas for inline optimisation control.
* condvar9.c: Add pragmas for inline optimisation control.

2002-02-02 23:15:28 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
[f58aab] (None) by rpj rpj

Barriers fixed and tested more extensively.

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

* barrier3.c: Fixed.
* barrier4.c: Fixed.
* barrier5.c: New; proves that all threads in the group
reaching the barrier wait and then resume together. Repeats
the test using groups of 1 to 16 threads. Each group of
threads must negotiate a large number of barriers (10000).
* spin4.c: Fixed.
* test.h (error_string): Modified the success (0) value.

2001-07-08 16:44:06 View
[e121b9] (None) by rpj rpj

2001-05-30 Ross Johnson <>

* 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

2001-05-29 Ross Johnson <>

Contributed by - Milan Gardian <>

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

Contributed by - Thomas Pfaff <>

* pthread.h (PTHREAD_MUTEX_DEFAULT): New; equivalent to
* (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:
* 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 Ross Johnson <>

Contributed by - Alexander Terekhov <>

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

2001-05-31 02:01:47 View
[199d96] (None) by rpj rpj

2000-09-08 Ross Johnson <>

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

* 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-07 15:41:11 View
[11eb4d] (None) by rpj rpj

2000-08-18 Ross Johnson <>

* Several: Fix typos from scripted edit session

* 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
* exit.c (pthread_exit): pthread_exit() value is now
returned via the thread structure exitStatus
* 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-18 08:02:29 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
[e2fd6e] (None) by rpj rpj

2000-07-25 Ross Johnson <>

* sched.c (sched_get_priority_max): Handle different WinCE and
Win32 priority values together.
(sched_get_priority_min): Ditto.
- Tristan Savatier <>

* 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 (_pthread_threadStart): Initialise ei[].
(_pthread_threadStart): When beginthread is used to start the
thread, force waiting until the creator thread had the
thread handle.

* cancel.c (_pthread_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 (_pthread_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 (_pthread_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 <>

* 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

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

* FAQ: Added Q5 and Q6.


2000-07-25 Ross Johnson <>

* runtest.bat: modified to work under W98.

* runall.bat: Add new tests; modified to work under W98.
It was ok under NT.

* Makefile: Add new tests.

* exception1.c: New; Test passing exceptions back to the
application and retaining library internal exceptions.

* join0.c: New; Test a single join.

2000-07-25 16:14: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
[588b7f] (None) by rpj rpj

1999-10-30 Ross Johnson <>

* create.c (pthread_create): Explicitly initialise thread state to
default values.

* cancel.c (pthread_setcancelstate): Check for NULL 'oldstate'
for compatibility with Solaris pthreads;
(pthread_setcanceltype): ditto:
- Erik Hensema <>

1999-10-23 Ross Johnson <>

* pthread.h (ctime_r): Fix incorrect argument "_tm"
- Erik Hensema <>

1999-10-30 Ross Johnson <>

* cancel1.c: New. Test pthread_setcancelstate and
pthread_setcanceltype functions.
* eyal1.c (waste_time): Change calculation to avoid FP exception
on Aplhas
- Rich Peters <>

1999-10-30 09:17:28 View
[9af51e] (None) by rpj rpj

Merged patches to main trunk.

1999-08-12 01:32:02 View
[ab9f05] (None) by rpj rpj

Wed Mar 24 11:32:07 1999 Ross Johnson <>
* misc.c (CancelableWait): Initialise exceptionInformation[2].
(pthread_self): Get a real Win32 thread handle for implicit threads.
* cancel.c (pthread_testcancel): Initialise exceptionInformation[2].
* implement.h (SE_INFORMATION): Fix values.
* private.c (_pthread_threadDestroy): Close the thread handle.
Fri Mar 19 12:57:27 1999 Ross Johnson <>
* cancel.c (comments): Update and cleanup.
Fri Mar 19 09:12:59 1999 Ross Johnson <>
* private.c (_pthread_threadStart): status returns PTHREAD_CANCELED.
* pthread.h (PTHREAD_CANCELED): defined.

1999-03-23 19:43:43 View
[c5573b] (None) by rpj rpj

Tue Mar 16 1999 Ross Johnson <>
* all: Add GNU LGPL and Copyright and Warranty.

1999-03-16 03:36:06 View
[a3db25] (snapshot-1999-02-10) (None) by rpj rpj

Thu Feb 4 10:07:28 1999 Ross Johnson <>
* global.c: Remove Pthread_exception instantiation.
* cancel.c (pthread_testcancel): Change C++ exception throw.
* implement.h: Remove extern declaration.

1999-02-09 14:59:13 View
Older >