summaryrefslogtreecommitdiff
path: root/create.c
AgeCommit message (Collapse)Author
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
* sync.c (pthread_detach): Use equality test, not assignment. * create.c (_pthread_start_call): Add call to Win32 CloseHandle() if thread is detached.
1998-07-24 * sync.c (pthread_join): Save valueptr arg in joinvalueptr forrpj
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().
1998-07-23Fri Jul 24 03:00:25 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* create.c (pthread_create): Ensure values of new attribute members are copied to the thread attribute object.
1998-07-23Fri Jul 24 00:21:21 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>rpj
* 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
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-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-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-12See the ChangeLog.rpj
1998-07-11Preliminary implementation. Lot's of FIXME's.rpj
1998-07-10 * create.c: Tidy function signature.bje
1998-07-091998-07-09 Ben Elliston <bje@cygnus.com>bje
* create.c (pthread_create): A dummy stub right now.