summaryrefslogtreecommitdiff
path: root/pthread.h
AgeCommit message (Collapse)Author
1998-07-25Sat Jul 25 00:00:13 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* 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.
1998-07-24Fri Jul 24 23:09:33 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* pthread.h: (pthread_cancel): Add function prototype. (pthread_testcancel): Ditto.
1998-07-241998-07-24 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_condattr_t): Rename dummy structure member. (pthread_mutexattr_t): Likewise.
1998-07-24Fri Jul 24 21:13:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* 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.
1998-07-24Minor #include and #ifdef fixes.bje
1998-07-241998-07-24 Ben Elliston <bje@cygnus.com>bje
* 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.
1998-07-24Fri Jul 24 16:33:17 1998 Ross Johnson <rpj@swan.canberra.edu.au>rpj
* 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.
1998-07-23Fri Jul 24 03:00:25 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* 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.
1998-07-231998-07-24 Ben Elliston <bje@cygnus.com>bje
* 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.
1998-07-231998-07-24 Ben Elliston <bje@cygnus.com>bje
* 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.
1998-07-23 * global.c: New. Global data objects declared here. These moved fromrpj
pthread.h. * pthread.h: Move implementation hidden definitions into implement.h. * implement.h: Move implementation hidden definitions from pthread.h. Add constants to index into the different handler stacks. * cleanup.c (_pthread_handler_push): Simplify args. Restructure. (_pthread_handler_pop): Simplify args. Restructure. (_pthread_handler_pop_all): Simplify args. Restructure.
1998-07-22Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* attr.c, implement.h, pthread.h, ChangeLog: Resolve CVS merge conflicts. * private.c (_pthread_find_thread_entry): Changes to return type to support leaner _pthread_threads_table[] which now only stores _pthread_thread_thread_t *. (_pthread_new_thread_entry): Internal changes. (_pthread_delete_thread_entry): Internal changes to avoid contention. Calling routines changed accordingly. * pthread.h: Modified cleanup macros to use new generic push and pop. Added destructor and atfork stacks to _pthread_threads_thread_t. * cleanup.c (_pthread_handler_push, _pthread_handler_pop, _pthread_handler_pop_all): Renamed cleanup push and pop routines and made generic to handle destructors and atfork handlers as well. * create.c (_pthread_start_call): New function is a wrapper for all new threads. It allows us to do some cleanup when the thread returns, ie. that is otherwise only done if the thread is cancelled. * exit.c (_pthread_vacuum): New function contains code from pthread_exit() that we need in the new _pthread_start_call() as well. * implement.h: Various additions and minor changes. * pthread.h: Various additions and minor changes. Change cleanup handler macros to use generic handler push and pop functions. * attr.c: Minor mods to all functions. (is_attr): Implemented missing function. * create.c (pthread_create): More clean up. * private.c (_pthread_find_thread_entry): Implement. (_pthread_delete_thread_entry): Implement. (_pthread_new_thread_entry): Implement. These functions manipulate the implementations internal thread table and are part of general code cleanup and modularisation. They replace _pthread_getthreadindex() which was removed. * exit.c (pthread_exit): Changed to use the new code above. * pthread.h: Add cancelability constants. Update comments.
1998-07-22i1998-07-22 Ben Elliston <bje@cygnus.com>bje
* attr.c (pthread_setstacksize): Update test of attr argument. (pthread_getstacksize): Likewise. (pthread_setstackaddr): Likewise. (pthread_getstackaddr): Likewise. (pthread_attr_init): No need to allocate any storage. (pthread_attr_destroy): No need to free any storage. * mutex.c (is_attr): Not likely to be needed; remove. (remove_attr): Likewise. (insert_attr): Likewise. * pthread.h (pthread_attr_t): Moved here from implement.h. * implement.h (_pthread_mutexattr_t): Moved to a public definition in pthread.h. There was little gain in hiding these details. (_pthread_condattr_t): Likewise.
1998-07-221998-07-22 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_atfork): Add function prototype. * fork.c (pthread_atfork): Preliminary implementation. (_pthread_fork): Likewise.
1998-07-21Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* cleanup.c (_pthread_cleanup_push): Implement. (_pthread_cleanup_pop): Implement. (_pthread_do_cancellation): Implement. These are private to the implementation. The real cleanup functions are macros. See below. * pthread.h (pthread_cleanup_push): Implement as a macro. (pthread_cleanup_pop): Implement as a macro. Because these are macros which start and end a block, the POSIX scoping requirement is observed. See the comment in the file. * exit.c (pthread_exit): Refine the code. * create.c (pthread_create): Code cleanup. * implement.h (RND_SIZEOF): Add RND_SIZEOF(T) to round sizeof(T) up to multiple of DWORD. Add function prototypes. * private.c (_pthread_getthreadindex): "*thread" should have been "thread". Detect empty slot fail condition.
1998-07-201998-07-20 Ben Elliston <bje@cygnus.com>bje
* pthread.h (_pthread_once_flag): Remove. (_pthread_once_lock): Remove. (pthread_once): Add function prototype. (pthread_once_t): Define this type.
1998-07-191998-07-20 Ben Elliston <bje@cygnus.com>bje
* pthread.h (_pthread_once_flag): Add new variable. (_pthread_once_lock): Add new mutex lock to ensure integrity of access to _pthread_once_flag.
1998-07-19Mon Jul 20 02:31:05 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* private.c (_pthread_getthreadindex): Implement. * pthread.h: Add application static data dependent on _PTHREADS_BUILD_DLL define. This is needed to avoid allocating non-sharable static data within the pthread DLL. * implement.h: Add _pthread_cleanup_stack_t, _pthread_cleanup_node_t and _PTHREAD_HASH_INDEX. * exit.c (pthread_exit): Begin work on cleanup and de-allocate thread-private storage. * create.c (pthread_create): Add thread to thread table. Keep a thread-private copy of the attributes with default values filled in when necessary. Same for the cleanup stack. Make pthread_create C run-time library friendly by using _beginthreadex() instead of CreateThread(). Fix error returns. Sun Jul 19 16:26:23 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * implement.h: Rename pthreads_thread_count to _pthread_threads_count. Create _pthread_threads_thread_t struct to keep thread specific data. * create.c: Rename pthreads_thread_count to _pthread_threads_count. (pthread_create): Handle errors from CreateThread().
1998-07-191998-07-19 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_key_t): Define this type. (pthread_key_create): Add function prototype. (pthread_setspecific): Likewise. (pthread_getspecific): Likwise. (pthread_key_delete): Likewise.
1998-07-171998-07-18 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_cond_t): Fix for u_int. Do not assume that the mutex contained withing the pthread_cond_t structure will be a critical section. Use our new POSIX type!
1998-07-171998-07-18 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_cond_init): Add function protoype. (pthread_cond_broadcast): Likewise. (pthread_cond_signal): Likewise. (pthread_cond_timedwait): Likewise. (pthread_cond_wait): Likewise. (pthread_cond_destroy): Likewise. (pthread_cond_t): Define this type.
1998-07-171998-07-17 Ben Elliston <bje@cygnus.com>bje
* pthread.h (PTHREADS_PROCESS_PRIVATE): Remove. (PTHREAD_PROCESS_SHARED): Likewise. No support for mutexes shared across processes for now. (pthread_mutex_t): Use a Win32 CRITICAL_SECTION type for better performance.
1998-07-131998-07-14 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_attr_init): Add function prototype. (pthread_attr_destroy): Likewise. (pthread_attr_setstacksize): Likewise. (pthread_attr_getstacksize): Likewise. (pthread_attr_setstackaddr): Likewise. (pthread_attr_getstackaddr): Likewise.
1998-07-131998-07-14 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_condattr_setpshared): Fix typo.
1998-07-12See the ChangeLog.rpj
1998-07-121998-07-13 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_condattr_t): Define this type. (pthread_condattr_init): Likewise. (pthread_condattr_destroy): Likewise. (pthread_condattr_setpshared): Likewise. (pthread_condattr_getpshared): Likewise.
1998-07-121998-07-13 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_mutex_t): Define this type. (pthread_mutex_destroy): Add function prototype. (pthread_lock): Likewise. (pthread_trylock): Likewise. (pthread_unlock): Likewise.
1998-07-121998-07-12 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_mutexattr_init): Add function prototype. (pthread_mutexattr_destroy): Likewise. (pthread_mutexattr_setpshared): Likewise. (pthread_mutexattr_getpshared): Likewise. (PTHREAD_PROCESS_PRIVATE): Define. (PTHREAD_PROCESS_SHARED): Define.
1998-07-121998-07-12 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_mutexattr_t): Define this type. (pthread_mutexattr_setprotocol): Add function prototype. (pthread_mutexattr_getprotocol): Likewise. (pthread_mutexattr_setprioceiling): Likewise. (pthread_mutexattr_getprioceiling): Likewise.
1998-07-101998-07-11 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_join): Add function prototype. (pthread_equal): Likewise.
1998-07-101998-07-10 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_self): Add function prototype. (pthread_t): Define this type.
1998-07-101998-07-10 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_exit): Add function prototype.
1998-07-091998-07-09 Ben Elliston <bje@cygnus.com>bje
* pthread.h (pthread_create): Add function prototype.