Code Log

Commit Date  
[1c38df] (exp-2001-02-10-passed) by rpj rpj

2001-02-09 Ross Johnson <>

* nonportable.c (pthread_mutex_setdefaulttype_np): New
function for changing the default mutex type.

* mutex.c (ptw32_InitializeCriticalSection): Removed.
(ptw32_InitializeCriticalSection): Removed.
(ptw32_InitializeCriticalSection): Removed.
(ptw32_InitializeCriticalSection): Removed.
(ptw32_InitializeCriticalSection): Removed.
(pthread_mutex_init): Apply Thomas Pfaff's original
patches; remove use of critical sections and adapt
for different mutex types (see log entry for 2001-01-10).
The disadvantage of using critical sections is that
they don't appear to be sharable between processes.
This implementation provides the opportunity to place
mutex objects in shared memory. Thread priority
determines the order in which waiting threads acquire
the mutex although the implementation includes a
mechanism to prevent threads hogging the mutex through
successive unlock/lock operations.
(pthread_mutex_destroy): Likewise.
(pthread_mutex_lock): Likewise.
(pthread_mutex_unlock): Likewise.
(pthread_mutex_trylock): Likewise.

* pthread.h (rand_r): Add redundant test of '_seed' arg
to avoid "unused variable" warnings. Any good compiler
will optimise the test away anyway.

2001-02-10 08:35:29 Tree
[1648c7] by rpj rpj

Remodeled mutex routines again to eliminate critical sections.

2001-02-09 06:51:30 Tree
[2b3eed] (exp-2001-02-09-passed) by rpj rpj

Fixes to new mutex routines and various tests.

2001-02-08 16:31:20 Tree
[3c0fbf] by rpj rpj

Change the purpose of rwlock6 test and add new rwlock7 test.

2001-02-07 13:08:54 Tree
[7a31ef] by rpj rpj

Updates and minor corrections and changes.

2001-02-07 08:45:46 Tree
[2f4a19] by rpj rpj

Revamp read-write locks and update cond vars.
See ChangeLog.

2001-02-07 03:48:23 Tree
[9a59a1] by rpj rpj

* mutex.c (pthread_mutexattr_settype): New; allow
the following types of mutex:
(pthread_mutex_lock): Process the lock request
according to the mutex type.

* mutex.c: No longer use Win32 mutexes as the
basis of POSIX mutexes when TryEnterCriticalSection
isn't supported; implement our own versions of
functions to emulate TryEnterCriticalSection when
it isn't supported by the system; don't allow recursive
mutex locks (similar to PTHREAD_MUTEX_ERRORCHECK
on other systems).
- Thomas Pfaff <>

2001-02-06 07:56:03 Tree
[ced3d3] by rpj rpj

Update Question 6.

2001-02-06 06:38:56 Tree
[a423d9] by rpj rpj


2001-02-06 06:30:51 Tree
[47ccfd] by rpj rpj

Update web URL.

2001-02-06 05:52:41 Tree
[25f0d9] by rpj rpj

Created experimental branch.

2001-02-06 05:44:38 Tree
[9171ee] by rpj rpj

Initial version of MS Developer Studio project files.

2001-01-01 03:48:51 Tree
[a97c54] by rpj rpj

Fix typo in URL.

2000-12-30 00:51:56 Tree
[9e771b] (snap-2000-12-29) by rpj rpj


2000-12-29 07:14:46 Tree
[0c2cb3] 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 Tree
[bab189] by rpj rpj

2000-10-10 Ross Johnson <>

* misc.c (pthread_self): Restore Win32 "last error"
cleared by TlsGetValue() call in
- "Steven Reddie" <>

2000-09-20 Ross Johnson <>

* 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.
- reported by Arthur Kantor <>

2000-12-28 05:43:49 Tree
[c94735] by rpj rpj

2000-12-28 Ross Johnson <>

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

* FAQ: Update Answer 6 re getting a fully working
Mingw32 built library.

2000-09-09 Ross Johnson <>

* pthread.h (ctime_r): Fix arg.

2000-12-28 Ross Johnson <>

* eyal1.c: Increase thread work loads.
* exception2.c: New test.
* exception3.c: New test.
* Makefile: Add new tests exception2.c and exception3.c.
* GNUmakefile: Likewise.

2000-12-11 Ross Johnson <>

* cleanup3.c: Remove unused variable.
* cleanup2.c: Likewise.
* exception1.c: Throw an exception rather than use
a deliberate zero divide so that catch(...) will
handle it under Mingw32. Mingw32 now builds the
library correctly to pass all tests - see Thomas
Pfaff's detailed instructions re needed changes
to Mingw32 in the Pthreads-Win32 FAQ.

2000-12-28 05:32:07 Tree
[548fc2] by rpj rpj

2000-09-13 Ross Johnson <>

* 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
- "Jef Gearhart" <>

2000-09-13 01:21:11 Tree
[63c486] (snap-2000-09-08) by rpj rpj

Note that pthreadGCE.dll is now built with Mingw32
but it still has known bugs.

2000-09-08 01:36:28 Tree
[9a5870] by rpj rpj


2000-09-08 01:29:38 Tree
[199d96] 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 Tree
[69b6d5] by rpj rpj

2000-09-02 Ross Johnson <>

* 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

* semaphore.c (_decrease_semaphore): Should be
a call to ptw32_decrease_semaphore.
(_increase_semaphore): Should be a call to

* misc.c (ptw32_cancelable_wait): Renamed from
(cond_wait_cleanup*): Rename to ptw32_cond_wait_cleanup*.
(ptw32_cond_timedwait): Add comments.

2000-09-02 09:34:19 Tree
[54286b] by rpj rpj

2000-09-02 Ross Johnson <>

* rwlock.c (_rwlock_check*): Renamed to
* 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*.

2000-09-02 04:02:20 Tree
[9250a2] by rpj rpj

Fix comment.

2000-09-02 03:30:07 Tree
[022109] by rpj rpj

New. Contains non-portable routines.

2000-09-02 03:23:39 Tree
Older >

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks