Code Log


Commit Date  
[e470da] (5.7 kB) by rpj rpj

Some cleanups, mostly x86_64 compat plus interlocked macros

2011-03-03 23:37:20 View
Download
[3ef988] (5.7 kB) by rpj rpj

''

2005-04-25 14:42:37 View
Download
[33507f] (5.9 kB) by rpj rpj

''

2005-04-18 04:53:55 View
Download
[7eb9d4] (5.7 kB) by rpj rpj

Copyright year updated

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

Copyright update

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

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

2004-11-03 01:08:41 View
Download
[045278] (5.6 kB) by rpj rpj

Changes to mutexes and semaphores - considered alpha for now

2004-10-22 15:06:41 View
Download
[de906e] (5.6 kB) by rpj rpj

Updated Copyright notice (date and contact address).

2003-08-19 03:31:50 View
Download
[b29903] (5.6 kB) 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
Download
[d432fa] (5.1 kB) by rpj rpj

Change #pragma inline_depth(8) to use empty () for default value.

2002-02-03 22:50:19 View
Download
[4a7243] (5.1 kB) 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)
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.

tests/
* 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
Download
[f3cbc4] (5.0 kB) 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
Download
[e121b9] (4.0 kB) by rpj rpj

2001-05-30 Ross Johnson <rpj@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 Ross Johnson <rpj@setup1.ise.canberra.edu.au>

Contributed by - Milan Gardian <Milan.Gardian@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 Ross Johnson <rpj@setup1.ise.canberra.edu.au>

Contributed by - Thomas Pfaff <tpfaff@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 Ross Johnson <rpj@special.ise.canberra.edu.au>

Contributed by - Alexander Terekhov <TEREKHOV@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]
.

2001-05-31 02:01:47 View
Download
[16cb1b] (4.0 kB) by rpj rpj

2000-08-13 Ross Johnson <rpj@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@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.

tests/ChangeLog:

2000-08-13 Ross Johnson <rpj@special.ise.canberra.edu.au>

* condvar3.c: Minor change to eliminate compiler
warning.

* condvar4.c: ditto.

* condvar5.c: ditto.

* condvar6.c: ditto.

* condvar7.c: ditto.

* condvar8.c: ditto.

* condvar9.c: ditto.

* exit1.c: Function needed return statement.

* cleanup1.c: Remove unnecessary printf arg.

* cleanup2.c: Fix cast.

* rwlock6.c: Fix casts.

* exception1.c (PtW32CatchAll): Had the wrong name;
fix casts.

* cancel3.c: Remove unused waitLock variable.

* GNUmakefile: Change library/dll naming; add new tests;
general minor changes.

* Makefile: Change library/dll naming; add targets for
testing each of the two VC++ EH scheme versions;
default target now issues help message; compile warnings
now interpreted as errors to stop the make; add new
tests; restructure to remove prerequisites needed
otherwise.

* README: Updated.

2000-08-14 03:43:09 View
Download
[6eb5bb] (4.0 kB) by rpj rpj

2000-08-06 Ross Johnson <rpj@special.ise.canberra.edu.au>

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

2000-08-05 Ross Johnson <rpj@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@special.ise.canberra.edu.au>

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

tests:

2000-08-06 Ross Johnson <rpj@special.ise.canberra.edu.au>

* 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 <rpj@special.ise.canberra.edu.au>

* cancel2.c: Use PtW32CatchAll macro if defined.

* exception1.c: Use PtW32CatchAll macro if defined.

2000-08-02 Ross Johnson <rpj@special.ise.canberra.edu.au>

* 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
Download
[a378d9] (4.0 kB) 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
Download
[8c2385] (4.0 kB) by rpj rpj

1999-10-17 Ross Johnson <rpj@ixobrychus.canberra.edu.au>

* rwlock.c (pthread_rwlock_destroy): Add cast to remove compile
warning.

* condvar.c (pthread_cond_broadcast): Only release semaphores
if there are waiting threads.

1999-10-15 Ross Johnson <rpj@ixobrychus.canberra.edu.au>

* condvar.c (cond_wait_cleanup): New static cleanup handler for
cond_timedwait;
(cond_timedwait): pthread_cleanup_push args changed;
canceling a thread while it's in pthread_cond_wait
will now decrement the waiters count and cleanup if it's the
last waiter.
- Lorin Hochstein <lmh@xiphos.ca> and
Peter Slacik <Peter.Slacik@tatramed.sk>;
the last waiter will now reset the CV's wasBroadcast flag
- Graham Dumpleton <Graham.Dumpleton@ra.pad.otc.telstra.com.au>.

1999-10-16 16:24:42 View
Download
[77d0a6] (snap-1999-05-30) (None) by rpj rpj

Added.

1999-05-29 07:46:49 View
Download
[f8af93] (snap-1999-03-15) (None) by rpj rpj

Mon Mar 15 00:20:13 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* condvar.c (pthread_cond_init): fix possible uninitialised use
of cv.
Sun Mar 14 21:01:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* condvar.c (pthread_cond_destroy): don't do full cleanup if
static initialised cv has never been used.
(cond_timedwait): check result of auto-initialisation.
tests/ChangeLog
Mon Mar 15 00:17:55 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* mutex1.c: only test mutex init and destroy; add assertions.
* count1.c: raise number of spawned threads to 60 (appears to
be the limit under Win98).
Sun Mar 14 21:31:02 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* test.h (assert): add assertion trace option.
Use:
"#define ASSERT_TRACE 1" to turn it on,
"#define ASSERT_TRACE 0" to turn it off (default).
* condvar3.c (main): add more assertions.
* condvar4.c (main): add more assertions.
* condvar1.c (main): add more assertions.

1999-03-14 05:29:18 View
Download
[b14e60] (None) by rpj rpj

Thu Mar 11 09:01:48 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.h (pthread_mutex_t): revert to (pthread_mutex_t *);
define a value to serve as PTHREAD_MUTEX_INITIALIZER.
(pthread_mutex_t_): remove staticinit and valid elements.
(pthread_cond_t): revert to (pthread_cond_t_ *);
define a value to serve as PTHREAD_COND_INITIALIZER.
(pthread_cond_t_): remove staticinit and valid elements.
* mutex.c (pthread_mutex_t args): adjust indirection of references.
(all functions): check for PTHREAD_MUTEX_INITIALIZER value;
check for NULL (invalid).
* condvar.c (pthread_cond_t args): adjust indirection of references.
(all functions): check for PTHREAD_COND_INITIALIZER value;
check for NULL (invalid).
Wed Mar 10 17:18:12 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* misc.c (CancelableWait): Undo changes from Mar 8 and 7.
tests/ChangeLog
Fri Mar 12 08:34:15 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* eyal1.c (main): Fix trylock loop; was not waiting for thread to lock
the "started" mutex.

1999-03-11 15:06:20 View
Download
[1e9697] (None) by rpj rpj

Mon Mar 8 11:18:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* misc.c (CancelableWait): Ensure cancelEvent handle is the lowest
indexed element in the handles array. Enhance test for abandoned
objects.
* pthread.h (PTHREAD_MUTEX_INITIALIZER): Trailing elements not
initialised are set to zero by the compiler. This avoids the
problem of initialising the opaque critical section element in it.
(PTHREAD_COND_INITIALIZER): Ditto.
* semaphore.c (_pthread_sem_timedwait): Check sem == NULL earlier.
Sun Mar 7 12:31:14 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* condvar.c (pthread_cond_init): set semaphore initial value
to 0, not 1. cond_timedwait was returning signaled immediately.
* misc.c (CancelableWait): Place the cancel event handle first
in the handle table for WaitForMultipleObjects. This ensures that
the cancel event is recognised and acted apon if both objects
happen to be signaled together.
* private.c (_pthread_cond_test_init_lock): Initialise and destroy.
* implement.h (_pthread_cond_test_init_lock): Add extern.
* global.c (_pthread_cond_test_init_lock): Add declaration.
* condvar.c (pthread_cond_destroy): check for valid initialised CV;
flag destroyed CVs as invalid.
(pthread_cond_init): pthread_cond_t is no longer just a pointer.
This is because PTHREAD_COND_INITIALIZER needs state info to reside
in pthread_cond_t so that it can initialise on first use. Will work on
making pthread_cond_t (and other objects like it) opaque again, if
possible, later.
(cond_timedwait): add check for statically initialisation of
CV; initialise on first use.
(pthread_cond_signal): check for valid CV.
(pthread_cond_broadcast): check for valid CV.
(_cond_check_need_init): Add.
* pthread.h (PTHREAD_COND_INITIALIZER): Fix.
(pthread_cond_t): no longer a pointer to pthread_cond_t_.
(pthread_cond_t_): add 'staticinit' and 'valid' elements.
tests/ChangeLog
Sun Mar 7 10:41:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* Makefile (condvar3, condvar4): Add tests.
* condvar4.c (General): Reduce to simple test case; prerequisite
is condvar3.c; add description.
* condvar3.c (General): Reduce to simple test case; prerequisite
is condvar2.c; add description.
* condvar2.c (General): Reduce to simple test case; prerequisite
is condvar1.c; add description.
* condvar1.c (General): Reduce to simple test case; add
description.
* Template.c (Comments): Add generic test detail.

1999-03-07 18:02:06 View
Download
[044244] (None) by rpj rpj

Sun Mar 7 10:41:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* condvar4.c (General): Reduce to simple test case; prerequisite
is condvar3.c; add description.
* condvar3.c (General): Reduce to simple test case; prerequisite
is condvar2.c; add description.
* condvar2.c (General): Reduce to simple test case; prerequisite
is condvar1.c; add description.
* condvar1.c (General): Reduce to simple test case; add
description.
* Template.c (Comments): Add generic test detail.

1999-03-06 16:53:35 View
Download
[346e0d] (None) by rpj rpj

1999-02-23 Ross Johnson <rpj@ise.canberra.edu.au>
* Template.c: Revamp.
* condvar1.c: Add.
* condvar2.c: Add.
* Makefile: Add condvar1 condvar2 tests.
* exit1.c, exit2.c, exit3.c: Cosmetic changes.

1999-02-22 16:51:52 View
Download