Age | Commit message (Collapse) | Author |
|
* 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
|
|
* sched.c: New file.
|
|
* mutex.c (pthread_mutexattr_setprotocol): Remove; not supported.
(pthread_mutexattr_getprotocol): Likewise.
(pthread_mutexattr_setprioceiling): Likewise.
(pthread_mutexattr_getprioceiling): Likewise.
|
|
|
|
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.
|
|
* 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.
|
|
|
|
* implement.h (_pthread_attr_t): Moved to a public definition in
pthread.h. There was little gain in hiding these details.
|
|
* 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.
|
|
* pthread.h (pthread_atfork): Add function prototype.
* fork.c (pthread_atfork): Preliminary implementation.
(_pthread_fork): Likewise.
|
|
|
|
|
|
* exit2.c (main): Fix size of pthread_t array.
|
|
* 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.
|
|
|
|
* misc.c (pthread_once): Don't use a per-application flag and
mutex--make `pthread_once_t' contain these elements in their
structure. The earlier version had incorrect semantics.
|
|
* pthread.h (_pthread_once_flag): Remove.
(_pthread_once_lock): Remove.
(pthread_once): Add function prototype.
(pthread_once_t): Define this type.
|
|
|
|
* misc.c (pthread_once): Implement.
|
|
* pthread.h (_pthread_once_flag): Add new variable.
(_pthread_once_lock): Add new mutex lock to ensure integrity of
access to _pthread_once_flag.
|
|
* private.c (_pthread_getthreadindex): Implement.
|
|
* 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().
|
|
|
|
* condvar.c (pthread_cond_wait): Generalise. Moved from here ..
(cond_wait): To here.
(pthread_cond_timedwait): Implement; use generalised cond_wait().
|
|
|
|
* tsd.c (pthread_key_create): Implement.
(pthread_setspecific): Likewise.
(pthread_getspecific): Likewise.
(pthread_key_delete): Likewise.
|
|
* pthread.h (pthread_key_t): Define this type.
(pthread_key_create): Add function prototype.
(pthread_setspecific): Likewise.
(pthread_getspecific): Likwise.
(pthread_key_delete): Likewise.
|
|
* mutex.c (pthread_mutex_trylock): Return ENOSYS if this function
is called on a Win32 platform which is not Windows NT.
|
|
|
|
|
|
* condvar.c (pthread_condattr_init): Do not attempt to malloc any
storage; none is needed now that condattr_t is an empty struct.
(pthread_condattr_destory): Likewise; do not free storage.
(pthread_condattr_setpshared): No longer supported; return ENOSYS.
(pthread_condattr_getpshared): Likewise.
(pthread_cond_init): Implement with help from Douglas Schmidt.
Remember to initialise the cv's internal mutex.
(pthread_cond_wait): Likewise.
(pthread_cond_signal): Likewise.
(pthread_cond_broadcast): Likewise.
(pthread_cond_timedwait): Preliminary implementation, but I need
to see some API documentation for `WaitForMultipleObject'.
(pthread_destory): Implement.
|
|
* 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!
|
|
* 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.
|
|
* implement.h (_pthread_condattr_t): Remove shared attribute.
|
|
|