Age | Commit message (Collapse) | Author |
|
* create.c (pthread_create): Start of rewrite. Not completed yet.
* private.c (_pthread_new_thread_entry): Start of rewrite. Not
complete.
* implement.h (_pthread_threads_thread): Rename, remove thread
member, add win32handle and ptstatus members.
(_pthread_t): Add.
* pthread.h: pthread_t is no longer mapped directly to a Win32
HANDLE type. This is so we can let the Win32 thread terminate and
reuse the HANDLE while pthreads holds it's own thread ID until
the last waiting join exits.
|
|
* private.c (_pthread_delete_thread_entry): Destroy the thread
entry attribute object before deleting the thread entry itself.
* attr.c (pthread_attr_init): Initialise cancel_pending = FALSE.
(pthread_attr_setdetachstate): Rename "detached" to "detachedstate".
(pthread_attr_getdetachstate): Ditto.
* exit.c (_pthread_exit): Fix incorrect check for detachedstate.
* implement.h (_pthread_call_t): Remove env member.
|
|
* implement.h (_pthread_new_thread_entry): Fix prototype.
(_pthread_find_thread_entry): Ditto.
(_pthread_delete_thread_entry): Ditto.
(_pthread_exit): Add prototype.
|
|
* exit.c (_pthread_exit): Clarify comment.
|
|
* exit.c (_pthread_exit): Move thread entry delete call from _pthread_vacuum()
into here. Add more explanation of thread entry deletion.
|
|
* exit.c (_pthread_exit): New function. Called from pthread_exit()
and _pthread_start_call() to exit the thread. It allows an extra
argument which is the return code passed to _endthreadex().
* create.c (_pthread_start_call): Change pthread_exit() call to
_pthread_exit() call.
|
|
* exit.c (_pthread_vacuum): Add thread entry deletion code
moved from _pthread_start_call(). See next item.
(pthread_exit): Remove longjmp(). Add mutex lock around thread table
manipulation code. This routine now calls _enthreadex().
* create.c (_pthread_start_call): Remove setjmp() call and move
cleanup code out. Call pthread_exit(NULL) to terminate the thread.
|
|
* tsd.c (pthread_getspecific): Update comments.
|
|
* mutex.c (pthread_mutexattr_setpshared): Not supported; remove.
(pthread_mutexattr_getpshared): Likewise.
* pthread.h (pthread_mutexattr_setpshared): Remove prototype.
(pthread_mutexattr_getpshared): Likewise.
|
|
* sync.c: Rename all instances of _pthread_count_mutex to
_pthread_table_mutex.
* implement.h: Rename _pthread_count_mutex to
_pthread_table_mutex.
* global.c: Rename _pthread_count_mutex to
_pthread_table_mutex.
* create.c (pthread_create): Add critical sections.
(_pthread_start_call): Rename _pthread_count_mutex to
_pthread_table_mutex.
|
|
* cancel.c (pthread_setcancelstate): Fix indirection bug and rename
"this" to "us".
|
|
* signal.c (pthread_sigmask): Rename "this" to "us" and fix some
minor syntax errors. Declare "us" and initialise it.
* sync.c (pthread_detach): Rename "this" to "target".
|
|
* pthread.h: Converting PTHREAD_* defines to alias the (const int)
values in global.c.
* global.c: Started converting PTHREAD_* defines to (const int) as
a part of making the eventual pthreads DLL binary compatible
through version changes.
|
|
* condvar.c (cond_wait): Add cancelation point. This applies the
point to both pthread_cond_wait() and pthread_cond_timedwait().
* exit.c (pthread_exit): Rename "this" to "us".
* implement.h: Add comment.
* sync.c (pthread_join): I've satisfied myself that pthread_detach()
does set the detached attribute in the thread entry attributes
to PTHREAD_CREATE_DETACHED. "if" conditions were changed to test
that attribute instead of a separate flag.
* create.c (pthread_create): Rename "this" to "us".
(pthread_create): cancelstate and canceltype are not attributes
so the copy to thread entry attribute storage was removed.
Only the thread itself can change it's cancelstate or canceltype,
ie. the thread must exist already.
|
|
* private.c (_pthread_delete_thread_entry): Mutex locks removed.
Mutexes must be applied at the caller level.
(_pthread_new_thread_entry): Ditto.
(_pthread_new_thread_entry): Init cancelstate, canceltype, and
cancel_pending to default values.
(_pthread_new_thread_entry): Rename "this" to "new".
(_pthread_find_thread_entry): Rename "this" to "entry".
(_pthread_delete_thread_entry): Rename "thread_entry" to "entry".
* create.c (_pthread_start_call): Mutexes changed to
_pthread_count_mutex. All access to the threads table entries is
under the one mutex. Otherwise chaos reigns.
Sat Jul 25 23:16:51 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h (_pthread_threads_thread): Move cancelstate and
canceltype members out of pthread_attr_t into here.
|
|
* fork.c (fork): Add comment.
|
|
* fork.c (fork): Autoconfiscate.
|
|
* create.c (_pthread_start_call): Set thread priority. Ensure our
thread entry is removed from the thread table but only if
pthread_detach() was called and there are no waiting joins.
(pthread_create): Set detach flag in thread entry if the
thread is created PTHREAD_CREATE_DETACHED.
* pthread.h (pthread_attr_t): Rename member "detachedstate".
* attr.c (pthread_attr_init): Rename attr members.
* exit.c (pthread_exit): Fix indirection mistake.
* implement.h (_PTHREAD_THREADS_TABLE_INDEX): Add.
* exit.c (_pthread_vacuum): Fix incorrect args to
_pthread_handler_pop_all() calls.
Make thread entry removal conditional.
* sync.c (pthread_join): Add multiple join and async detach handling.
* implement.h (_PTHREAD_THREADS_TABLE_INDEX): Add.
* global.c (_pthread_threads_mutex_table): Add.
* implement.h (_pthread_once_flag): Remove.
(_pthread_once_lock): Ditto.
(_pthread_threads_mutex_table): Add.
* global.c (_pthread_once_flag): Remove.
(_pthread_once_lock): Ditto.
* sync.c (pthread_join): Fix tests involving new return value
from _pthread_find_thread_entry().
(pthread_detach): Ditto.
* private.c (_pthread_find_thread_entry): Failure return code
changed from -1 to NULL.
|
|
|
|
* create.c (pthread_create): Change . to -> in sigmask memcpy() args.
|
|
* pthread.h: (pthread_cancel): Add function prototype.
(pthread_testcancel): Ditto.
|
|
* pthread.h (pthread_condattr_t): Rename dummy structure member.
(pthread_mutexattr_t): Likewise.
|
|
|
|
* cancel.c (pthread_cancel): Implement.
(pthread_testcancel): Implement.
* exit.c (pthread_exit): Add comment explaining the longjmp().
* implement.h (_pthread_threads_thread_t): New member cancelthread.
(_PTHREAD_YES): Define.
(_PTHREAD_NO): Define.
(RND_SIZEOF): Remove.
* create.c (pthread_create): Rename cancelability to cancelstate.
* pthread.h (pthread_attr_t): Rename cancelability to cancelstate.
(PTHREAD_CANCELED): Define.
|
|
|
|
|
|
* pthread.h (SIG_BLOCK): Define if not already defined.
(SIG_UNBLOCK): Likewise.
(SIG_SETMASK): Likewise.
(pthread_attr_t): Add signal mask member.
(pthread_sigmask): Add function prototype.
* signal.c (pthread_sigmask): Implement.
* create.c: #include <string.h> to get a prototype for memcpy().
(pthread_create): New threads inherit their creator's signal
mask. Copy the signal mask to the new thread structure.
|
|
|
|
* fork.c (pthread_atfork): Add all the necessary push calls.
Local implementation semantics:
If we get an ENOMEM at any time then ALL handlers
(including those from previous pthread_atfork() calls) will be
popped off each of the three atfork stacks before we return.
(fork): Add all the necessary pop calls. Add the thread cancellation
and join calls to the child fork.
Add #includes.
* implement.h: (_pthread_handler_push): Fix return type and stack arg
type in prototype.
(_pthread_handler_pop): Fix stack arg type in prototype.
(_pthread_handler_pop_all): Fix stack arg type in prototype.
* cleanup.c (_pthread_handler_push): Change return type to int and
return ENOMEM if malloc() fails.
|
|
* sync.c (pthread_detach): Use equality test, not assignment.
* create.c (_pthread_start_call): Add call to Win32 CloseHandle()
if thread is detached.
|
|
* sync.c (pthread_detach): Close the Win32 thread handle to
emulate detached (or daemon) threads.
|
|
|
|
pthread_exit() to use.
* private.c (_pthread_new_thread_entry): Initialise joinvalueptr to
NULL.
* create.c (_pthread_start_call): Rewrite to facilitate joins.
pthread_exit() will do a longjmp() back to here. Does appropriate
cleanup and exit/return from the thread.
(pthread_create): _beginthreadex() now passes a pointer to our
thread table entry instead of just the call member of that entry.
* implement.h (_pthread_threads_thread): New member
void ** joinvalueptr.
(_pthread_call_t): New member jmpbuf env.
* exit.c (pthread_exit): Major rewrite to handle joins and handing
value pointer to joining thread. Uses longjmp() back to
_pthread_start_call().
|
|
* create.c (pthread_create): Ensure values of new attribute members
are copied to the thread attribute object.
|
|
* attr.c (pthread_attr_destroy): Fix merge conflicts.
(pthread_attr_getdetachstate): Fix merge conflicts.
(pthread_attr_setdetachstate): Fix merge conflicts.
* pthread.h: Fix merge conflicts.
* sync.c (pthread_join): Fix merge conflicts.
|
|
|
|
|
|
|
|
* attr.c (pthread_attr_getdetachstate): Implement.
(pthread_attr_setdetachstate): Likewise.
|
|
|
|
* pthread.h (PTHREAD_CREATE_JOINABLE): Define.
(PTHREAD_CREATE_DETACHED): Likewise.
(pthread_attr_t): Add new structure member `detached'.
(pthread_attr_getdetachstate): Add function prototype.
(pthread_attr_setdetachstate): Likewise.
|
|
* sync.c (pthread_join): Return if the target thread is detached.
|
|
|
|
|
|
* pthread.h (sched_param): Define this type.
(pthread_attr_getschedparam): Add function prototype.
(pthread_attr_setschedparam): Likewise.
(pthread_setcancelstate): Likewise.
(pthread_setcanceltype): Likewise.
(sched_get_priority_min): Likewise.
(sched_get_priority_max): Likewise.
(pthread_mutexattr_setprotocol): Remove; not supported.
(pthread_mutexattr_getprotocol): Likewise.
(pthread_mutexattr_setprioceiling): Likewise.
(pthread_mutexattr_getprioceiling): Likewise.
(pthread_attr_t): Add canceltype member. Update comments.
(SCHED_OTHER): Define this scheduling policy constant.
(SCHED_FIFO): Likewise.
(SCHED_RR): Likewise.
(SCHED_MIN): Define the lowest possible value for this constant.
(SCHED_MAX): Likewise, the maximum possible value.
(PTHREAD_CANCEL_ASYNCHRONOUS): Redefine.
(PTHREAD_CANCEL_DEFERRED): Likewise.
|
|
* attr.c (pthread_attr_init): Initialise cancelability and
canceltype structure members.
|
|
* implement.h (_PTHREAD_CANCEL_DEFAULTS): Remove. Bit fields
proved to be too cumbersome. Set the defaults in attr.c using the
public PTHREAD_CANCEL_* constants.
|
|
* sched.c (pthread_setschedparam): Implement.
(pthread_getschedparam): Implement.
(sched_get_priority_max): Validate policy argument.
(sched_get_priority_min): Likewise.
|
|
* cancel.c: New file.
|
|
* create.c (pthread_create): Arg to _pthread_new_thread_entry()
changed. See next entry. Move mutex locks out. Changes made yesterday
and today allow us to start the new thread running rather than
temporarily suspended.
* private.c (_pthread_new_thread_entry): _pthread_thread_table
was changed back to a table of thread structures rather than pointers.
As such we're trading storage for increaded speed. This routine
was modified to work with the new table. Mutex lock put in around
global data accesses.
(_pthread_find_thread_entry): Ditto
(_pthread_delete_thread_entry): Ditto
|