Age | Commit message (Collapse) | Author |
|
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>
|
|
* 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.
|
|
* Makefile: Some refinement.
* *.c: More exhaustive checking through assertions; clean up;
add some more tests.
|
|
* 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.
|
|
* eyal1.c: New file; contributed by Eyal Lebedinsky
<eyal@eyal.emu.id.au>.
|