Age | Commit message (Collapse) | Author |
|
|
|
* create2.c: New; Test that pthread_t contains
the W32 HANDLE before it calls the thread routine
proper.
|
|
* tsd.c (pthread_create_key): Initialise temporary
key before returning it's address to avoid race
conditions.
|
|
|
|
* 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.
|
|
* cleanup.c (pthread_pop_cleanup): Remove _pthread
prefix from __except and catch keywords; implement.h
now simply undefines _pthread__except and
_pthread_catch if defined; VC++ was not textually
substituting _pthread_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 (_pthread_threadStart): Ditto.
(_pthread_callUserDestroyRoutines): Ditto.
* implement.h (_pthread__except): Remove #define.
(_pthread_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.
tests/ChangeLog:
2000-08-10 Ross Johnson <rpj@special.ise.canberra.edu.au>
* eyal1.c (main): Change implicit cast to explicit
cast when passing "print_server" function pointer;
G++ no longer allows implicit func parameter casts.
* cleanup1.c: Remove unused "waitLock".
(main): Fix implicit parameter cast.
* cancel2.c (main): Fix implicit parameter cast.
* cancel4.c (main): Fix implicit parameter cast.
* cancel3.c (main): Fix implicit parameter cast.
* GNUmakefile: Renamed from Makefile; Add missing
cancel1 and cancel2 test targets.
* Makefile: Converted for use with MS nmake.
|
|
|
|
* 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.
|
|
|
|
* sched.c (sched_get_priority_max): Handle different WinCE and
Win32 priority values together.
(sched_get_priority_min): Ditto.
- Tristan Savatier <tristan@mpegtv.com>
* 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 <rpj@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@special.ise.canberra.edu.au>
* FAQ: Added Q5 and Q6.
tests/ChangeLog:
2000-07-25 Ross Johnson <rpj@special.ise.canberra.edu.au>
* 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.
|
|
|
|
- asynchronous cancellation added
- attempt to hide internal exceptions from applications
- kernel32 load/free problem fixed
- new tests
- changes only to comments in some tests
|
|
1999-10-30 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* 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 <erik.hensema@group2000.nl>
1999-10-23 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.h (ctime_r): Fix incorrect argument "_tm"
- Erik Hensema <erik.hensema@group2000.nl>
tests/ChangeLog:
1999-10-30 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* cancel1.c: New. Test pthread_setcancelstate and
pthread_setcanceltype functions.
* eyal1.c (waste_time): Change calculation to avoid FP exception
on Aplhas
- Rich Peters <rpeters@micro-magic.com>
|
|
* 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>.
|
|
|
|
* rwlock6.c: New test.
|
|
|
|
* rwlock5.c: New test.
|
|
The following code for POSIX read/write locks was contributed
by Aurelio Medina.
* implement.h (pthread_rwlock_t_): Add.
* pthread.h (pthread_rwlock_t): Add.
(PTHREAD_RWLOCK_INITIALIZER): Add.
Add rwlock function prototypes.
* rwlock.c: New module.
* pthread.def: Add new rwlock functions.
* private.c (_pthread_processInitialize): initialise
_pthread_rwlock_test_init_lock critical section.
* global.c (_pthread_rwlock_test_init_lock): Add.
* mutex.c (pthread_mutex_destroy): Don't free mutex memory
if mutex is PTHREAD_MUTEX_INITIALIZER and has not been
initialised yet.
tests/ChangeLog
Sep 15 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* rwlock1.c: New test.
* rwlock2.c: New test.
* rwlock3.c: New test.
* rwlock4.c: New test.
|
|
* exit.c (pthread_exit): Fix reference to potentially
uninitialised pointer.
1999-08-21 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): Apply fix of 1999-08-19
this time to C++ and non-trapped C versions. Ommitted to
do this the first time through.
tests/ChangeLog:
Aug 22 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* runall.bat (join2): Add test.
|
|
* private.c (_pthread_threadStart): Return exit status from
the application thread startup routine.
- Milan Gardian <mg@tatramed.sk>
1999-08-18 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* exit.c (pthread_exit): Put status into pthread_t->exitStatus
- John Bossom <john.Bossom@cognos.com>
* private.c (_pthread_threadStart): Set pthread->exitStatus
on exit of try{} block.
- John Bossom <john.Bossom@cognos.com>
* 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 <john.Bossom@cognos.com>
Tue Aug 17 20:17:58 CDT 1999 Mumit Khan <khan@xraylith.wisc.edu>
* 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 <khan@xraylith.wisc.edu>
* Makefile.in (LD): Delete entry point.
* acconfig.h (STDCALL): Delete unused macro.
* configure.in: Remove test for STDCALL.
* config.h.in: 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 <rpj@ixobrychus.canberra.edu.au>
* exit.c (pthread_exit): Don't call pthread_self() but
get thread handle directly from TSD for efficiency.
|
|
1999-08-12 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): ei[] only declared if _MSC_VER.
tests/ChangeLog:
Wed Aug 12 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* Makefile (LIBS): Add -L.
|
|
|
|
|
|
Sat May 8 09:42:30 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.def (sem_open): Add.
(sem_close): Add.
(sem_unlink): Add.
(sem_getvalue): Add.
* FAQ (Question 3): Add.
Thu Apr 8 01:16:23 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* semaphore.c (sem_open): New function; returns an error (ENOSYS).
(sem_close): ditto.
(sem_unlink): ditto.
(sem_getvalue): ditto.
* semaphore.h (_POSIX_SEMAPHORES): define.
./tests/ChangeLog
Sat May 29 23:29:04 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* runall.bat (condvar5): Add new test.
* runall.bat (condvar6): Add new test.
* Makefile (condvar5) : Add new test.
* Makefile (condvar6) : Add new test.
* condvar5.c: New test for pthread_cond_broadcast().
* condvar6.c: New test for pthread_cond_broadcast().
|
|
* errno.c (_REENTRANT || _MT): Invert #if condition.
* pthread.h (_errno): Conditionally include prototype.
|
|
* *.c (comments): Remove individual attributions - these are
documented sufficiently elsewhere.
* implement.h (pthread.h): Remove extraneous include.
|
|
Sun Apr 4 11:05:57 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* sched.c (sched.h): Include.
* sched.h: New file for POSIX 1b scheduling.
* pthread.h: Move opaque structures to implement.h; move sched_*
prototypes out and into sched.h.
* implement.h: Add opaque structures from pthread.h.
* sched.c (sched_yield): New function.
* condvar.c (_pthread_sem_*): Rename to sem_*; except for
_pthread_sem_timedwait which is an private function.
Sat Apr 3 23:28:00 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* Makefile.in (OBJS): Add errno.o.
Fri Apr 2 11:08:50 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h (_pthread_sem_*): Remove prototypes now defined in
semaphore.h.
* pthread.h (sempahore.h): Include.
* semaphore.h: New file for POSIX 1b semaphores.
* pthread.h (_pthread_sem_t): Change to sem_t.
* semaphore.c (_pthread_sem_*): Change to sem_*; these functions
will be exported from the library; set errno on error.
- John Bossom <jebossom@cognos.com>
(_pthread_sem_timedwait): Moved to private.c.
* private.c (_pthread_sem_timedwait): Moved from semaphore.c;
set errno on error.
* errno.c (_errno): New file. New function.
- John Bossom
* pthread.h (pthread_t_): Add per-thread errno element.
tests/ChangeLog
Sun Apr 4 12:04:28 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* tsd1.c (mythread): Change Sleep(0) to sched_yield().
(sched.h): Include.
* condvar3.c (mythread): Remove redundant Sleep().
* runtest.bat: Re-organised to make more informative.
|
|
Fri Mar 19 09:12:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_threadStart): status returns PTHREAD_CANCELED.
* pthread.h (PTHREAD_CANCELED): defined.
==> tests/ChangeLog <==
Fri Mar 19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* *.bat: redirect unwanted output to nul:
* runall.bat: new.
* cancel1.c: new. Not part of suite yet.
|
|
* 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.
|
|
* tryentercs.c: Apply typo patch from bje.
* tryentercs2.c: Ditto.
|
|
* 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.
|
|
|
|
* 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.
|
|
* 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.
|
|
|
|
* Template.c: Revamp.
* condvar1.c: Add.
* condvar2.c: Add.
* Makefile: Add condvar1 condvar2 tests.
* exit1.c, exit2.c, exit3.c: Cosmetic changes.
|
|
* Makefile: Some refinement.
* *.c: More exhaustive checking through assertions; clean up;
add some more tests.
|
|
* Makefile: Now actually runs the tests.
* tests.h: Define our own assert macro. The Mingw32
version pops up a dialog but we want to run non-interactively.
* equal1.c: use assert a little more directly so that it
prints the actual call statement.
* exit1.c: Modify to return 0 on success, 1 on failure.
|
|
* pthread.h (PTHREAD_MUTEX_INITIALIZER): missing braces around
cs element initialiser.
Bring some tests up-to-date.
|
|
* README: Update.
* Makefile: New file. Run all tests automatically. Primitive tests
are run first; more complex tests are run last.
* count1.c: New test. Validate the thread count.
* exit2.c: Perform a simpler test.
* exit3.c: New test. Replaces exit2.c, since exit2.c needs to
perform simpler checking first.
* create1.c: Update to use the new testsuite exiting convention.
* equal1.c: Likewise.
* mutex1.c: Likewise.
* mutex2.c: Likewise.
* once1.c: Likewise.
* self2.c: Likewise.
* self3.c: Likewise.
* tsd1.c: Likewise.
|
|
* tests/mutex2.c: Test static mutex initialisation.
* tests/test.h: New. Declares a table mapping error numbers to
error names.
|
|
* misc.c (pthread_equal): Fix inverted result.
|
|
|
|
|
|
* pthread.h (pthread_mutexattr_t): Changed to a pointer.
* mutex.c (pthread_mutex_init): Conditionally create Win32 mutex
- from John Bossom's implementation.
(pthread_mutex_destroy): Conditionally close Win32 mutex
- from John Bossom's implementation.
(pthread_mutexattr_init): Replaced by John Bossom's version.
(pthread_mutexattr_destroy): Ditto.
(pthread_mutexattr_getpshared): New function from John Bossom's
implementation.
(pthread_mutexattr_setpshared): New function from John Bossom's
implementation.
Tue Jan 19 18:27:42 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* pthread.h (pthreadCancelableTimedWait): New prototype.
(pthreadCancelableWait): Remove second argument.
* misc.c (CancelableWait): New static function is
pthreadCancelableWait() renamed.
(pthreadCancelableWait): Now just calls CancelableWait() with
INFINITE timeout.
(pthreadCancelableTimedWait): Just calls CancelableWait()
with passed in timeout.
* private.c (_pthread_sem_timedwait): 'abstime' arg really is
absolute time. Calculate relative time to wait from current
time before passing timeout to new routine
pthreadCancelableTimedWait().
- Scott Lightner <scott@curriculum.com>
Tue Jan 19 10:27:39 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.h (pthread_mutexattr_setforcecs_np): New prototype.
* mutex.c (pthread_mutexattr_init): Init 'pshared' and 'forcecs'
attributes to 0.
(pthread_mutexattr_setforcecs_np): New function (not portable).
* pthread.h (pthread_mutex_t):
Add 'mutex' element. Set to NULL in PTHREAD_MUTEX_INITIALIZER.
The pthread_mutex_*() routines will try to optimise performance
by choosing either mutexes or critical sections as the basis
for pthread mutexes for each indevidual mutex.
(pthread_mutexattr_t_): Add 'forcecs' element.
Some applications may choose to force use of critical sections
if they know that:-
the mutex is PROCESS_PRIVATE and,
either the OS supports TryEnterCriticalSection() or
pthread_mutex_trylock() will never be called on the mutex.
This attribute will be setable via a non-portable routine.
Note: We don't yet support PROCESS_SHARED mutexes, so the
implementation as it stands will default to Win32 mutexes only if
the OS doesn't support TryEnterCriticalSection. On Win9x, and early
versions of NT 'forcecs' will need to be set in order to get
critical section based mutexes.
Sun Jan 17 12:01:26 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.h (PTHREAD_MUTEX_INITIALIZER): Init new 'staticinit'
value to '1' and existing 'valid' value to '1'.
* global.c (_pthread_mutex_test_init_lock): Add.
* implement.h (_pthread_mutex_test_init_lock.): Add extern.
* private.c (_pthread_processInitialize): Init critical section for
global lock used by _mutex_check_need_init().
(_pthread_processTerminate): Ditto (:s/Init/Destroy/).
* dll.c (dllMain): Move call to FreeLibrary() so that it is only
called once when the process detaches.
* mutex.c (_mutex_check_need_init): New static function to test
and init PTHREAD_MUTEX_INITIALIZER mutexes. Provides serialised
access to the internal state of the uninitialised static mutex.
Called from pthread_mutex_trylock() and pthread_mutex_lock() which
do a quick unguarded test to check if _mutex_check_need_init()
needs to be called. This is safe as the test is conservative
and is repeated inside the guarded section of
_mutex_check_need_init(). Thus in all calls except the first
calls to lock static mutexes, the additional overhead to lock any
mutex is a single memory fetch and test for zero.
* pthread.h (pthread_mutex_t_): Add 'staticinit' member. Mutexes
initialised by PTHREAD_MUTEX_INITIALIZER aren't really initialised
until the first attempt to lock it. Using the 'valid'
flag (which flags the mutex as destroyed or not) to record this
information would be messy. It is possible for a statically
initialised mutex such as this to be destroyed before ever being
used.
* mutex.c (pthread_mutex_trylock): Call _mutex_check_need_init()
to test/init PTHREAD_MUTEX_INITIALIZER mutexes.
(pthread_mutex_lock): Ditto.
(pthread_mutex_unlock): Add check to ensure we don't try to unlock
an unitialised static mutex.
(pthread_mutex_destroy): Add check to ensure we don't try to delete
a critical section that we never created. Allows us to destroy
a static mutex that has never been locked (and hence initialised).
(pthread_mutex_init): Set 'staticinit' flag to 0 for the new mutex.
|
|
* private.c (_pthread_sem_timedwait): Move from semaphore.c.
* semaphore.c : Remove redundant #includes.
(_pthread_sem_timedwait): Move to private.c.
(sem_wait): Add missing abstime arg to pthreadCancelableWait() call.
1999-01-17 Ross Johnson <rpj@ise.canberra.edu.au>
* runtest: New script to build and run a test in the tests directory.
|
|
This will be tagged as snapshot-1999-01-04-1305
|
|
* cleanup.c (_pthread_handler_push): Fixed bug appending new
handler to list reported by Peter Slacik
<Peter.Slacik@leibinger.freinet.de>.
(new_thread): Rename poorly named local variable to
"new_handler".
|