diff options
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 642 |
1 files changed, 324 insertions, 318 deletions
@@ -1,5 +1,11 @@ 2000-08-17 Ross Johnson <rpj@special.ise.canberra.edu.au> + * All applicable: Change _pthread_ prefix to + ptw32_ prefix to remove leading underscores + from private library identifiers (single + and double leading underscores are reserved in the + ANSI C standard for compiler implementations). + * tsd.c (pthread_create_key): Initialise temporary key before returning it's address to avoid race conditions. @@ -66,18 +72,18 @@ * cleanup.c (pthread_pop_cleanup): Remove _pthread prefix from __except and catch keywords; implement.h - now simply undefines _pthread__except and - _pthread_catch if defined; VC++ was not textually - substituting _pthread_catch etc back to catch as + now simply undefines ptw32__except and + ptw32_catch if defined; VC++ was not textually + substituting ptw32_catch etc back to catch as it was redefined; the reason for using the prefixed version was to make it clear that it was not using the pthread.h redefined catch keyword. - * private.c (_pthread_threadStart): Ditto. - (_pthread_callUserDestroyRoutines): Ditto. + * private.c (ptw32_threadStart): Ditto. + (ptw32_callUserDestroyRoutines): Ditto. - * implement.h (_pthread__except): Remove #define. - (_pthread_catch): Remove #define. + * implement.h (ptw32__except): Remove #define. + (ptw32_catch): Remove #define. * GNUmakefile (pthread.a): New target to build libpthread32.a from pthread.dll using dlltool. @@ -133,24 +139,24 @@ a local copy of the handle for internal use until pthread_create returns. - * private.c (_pthread_threadStart): Initialise ei[]. - (_pthread_threadStart): When beginthread is used to start the + * private.c (ptw32_threadStart): Initialise ei[]. + (ptw32_threadStart): When beginthread is used to start the thread, force waiting until the creator thread had the thread handle. - * cancel.c (_pthread_cancel_thread): Include context switch + * cancel.c (ptw32_cancel_thread): Include context switch code for defined(_X86_) environments in addition to _M_IX86. * rwlock.c (pthread_rwlock_destroy): Assignment changed to avoid compiler warning. - * private.c (_pthread_get_exception_services_code): Cast + * private.c (ptw32_get_exception_services_code): Cast NULL return value to avoid compiler warning. * cleanup.c (pthread_pop_cleanup): Initialise "cleanup" variable to avoid compiler warnings. - * misc.c (_pthread_new): Change "new" variable to "t" to avoid + * misc.c (ptw32_new): Change "new" variable to "t" to avoid confusion with the C++ keyword of the same name. * condvar.c (cond_wait_cleanup): Initialise lastWaiter variable. @@ -234,10 +240,10 @@ * implement.h: Include SEH code only if MSC is not compiling as C++. - * cancel.c (_pthread_cancel_thread): Add _M_IX86 check. + * cancel.c (ptw32_cancel_thread): Add _M_IX86 check. (pthread_testcancel): Include SEH code only if MSC is not compiling as C++. - (_pthread_cancel_self): Include SEH code only if MSC is not + (ptw32_cancel_self): Include SEH code only if MSC is not compiling as C++. 2000-01-06 Ross Johnson <rpj@special.ise.canberra.edu.au> @@ -247,38 +253,38 @@ 2000-01-04 Ross Johnson <rpj@special.ise.canberra.edu.au> - * private.c (_pthread_get_exception_services_code): New; returns + * private.c (ptw32_get_exception_services_code): New; returns value of EXCEPTION_PTHREAD_SERVICES. - (_pthread_processInitialize): Remove initialisation of - _pthread_exception_services which is no longer needed. + (ptw32_processInitialize): Remove initialisation of + ptw32_exception_services which is no longer needed. - * pthread.h (_pthread_exception_services): Remove extern. - (_pthread_get_exception_services_code): Add function prototype; + * pthread.h (ptw32_exception_services): Remove extern. + (ptw32_get_exception_services_code): Add function prototype; use this to return EXCEPTION_PTHREAD_SERVICES value instead of - using the _pthread_exception_services variable which I had + using the ptw32_exception_services variable which I had trouble exporting through pthread.def. - * global.c (_pthread_exception_services): Remove declaration. + * global.c (ptw32_exception_services): Remove declaration. 1999-11-22 Ross Johnson <rpj@special.ise.canberra.edu.au> - * implement.h: Forward declare _pthread_new(); + * implement.h: Forward declare ptw32_new(); - * misc.c (_pthread_new): New; alloc and initialise a new pthread_t. + * misc.c (ptw32_new): New; alloc and initialise a new pthread_t. (pthread_self): New thread struct is generated by new routine - _pthread_new(). + ptw32_new(). * create.c (pthread_create): New thread struct is generated - by new routine_pthread_new(). + by new routine ptw32_new(). 1999-11-21 Ross Johnson <rpj@special.ise.canberra.edu.au> - * global.c (_pthread_exception_services): Declare new variable. + * global.c (ptw32_exception_services): Declare new variable. - * private.c (_pthread_threadStart): Destroy thread's + * private.c (ptw32_threadStart): Destroy thread's cancelLock mutex; make 'catch' and '__except' usageimmune to redfinitions in pthread.h. - (_pthread_processInitialize): Init new constant _pthread_exception_services. + (ptw32_processInitialize): Init new constant ptw32_exception_services. * create.c (pthread_create): Initialise thread's cancelLock mutex. @@ -292,15 +298,15 @@ won't catch our internal exceptions. (__except): ditto for __except. - * implement.h (_pthread_catch): Define internal version + * implement.h (ptw32_catch): Define internal version of 'catch' because 'catch' is redefined by pthread.h. (__except): ditto for __except. (struct pthread_t_): Add cancelLock mutex for async cancel safety. - * cancel.c (_pthread_cancel_self): New; part of the async + * cancel.c (ptw32_cancel_self): New; part of the async cancellation implementation. - (_pthread_cancel_thread): Ditto; this function is X86 + (ptw32_cancel_thread): Ditto; this function is X86 processor specific. (pthread_setcancelstate): Add check for pending async cancel request and cancel the calling thread if @@ -421,9 +427,9 @@ Sat Sep 10 12:56:13 1999 Ross Johnson <rpj@swan.canberra.edu.au> Add rwlock function prototypes. * rwlock.c: New module. * pthread.def: Add new rwlock functions. - * private.c (_pthread_processInitialize): initialise - _pthread_rwlock_test_init_lock critical section. - * global.c (_pthread_rwlock_test_init_lock): Add. + * private.c (ptw32_processInitialize): initialise + ptw32_rwlock_test_init_lock critical section. + * global.c (ptw32_rwlock_test_init_lock): Add. * mutex.c (pthread_mutex_destroy): Don't free mutex memory if mutex is PTHREAD_MUTEX_INITIALIZER and has not been @@ -441,13 +447,13 @@ Wed Sep 8 12:56:13 1999 Ross Johnson <rpj@swan.canberra.edu.au> 1999-08-21 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_threadStart): Apply fix of 1999-08-19 + * private.c (ptw32_threadStart): Apply fix of 1999-08-19 this time to C++ and non-trapped C versions. Ommitted to do this the first time through. 1999-08-19 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_threadStart): Return exit status from + * private.c (ptw32_threadStart): Return exit status from the application thread startup routine. - Milan Gardian <mg@tatramed.sk> @@ -455,7 +461,7 @@ Wed Sep 8 12:56:13 1999 Ross Johnson <rpj@swan.canberra.edu.au> * exit.c (pthread_exit): Put status into pthread_t->exitStatus - John Bossom <john.Bossom@cognos.com> - * private.c (_pthread_threadStart): Set pthread->exitStatus + * private.c (ptw32_threadStart): Set pthread->exitStatus on exit of try{} block. - John Bossom <john.Bossom@cognos.com> * sync.c (pthread_join): use pthread_exitStatus value if the @@ -467,8 +473,8 @@ Tue Aug 17 20:17:58 CDT 1999 Mumit Khan <khan@xraylith.wisc.edu> * create.c (pthread_create): Add CRTDLL suppport. * exit.c (pthread_exit): Likewise. - * private.c (_pthread_threadStart): Likewise. - (_pthread_threadDestroy): Likewise. + * private.c (ptw32_threadStart): Likewise. + (ptw32_threadDestroy): Likewise. * sync.c (pthread_join): Likewise. * tests/join1.c (main): Warn about partial support for CRTDLL. @@ -481,8 +487,8 @@ Tue Aug 17 20:00:08 1999 Mumit Khan <khan@xraylith.wisc.edu> * errno.c (_errno): Fix self type. * pthread.h (PT_STDCALL): Move from here to * implement.h (PT_STDCALL): here. - (_pthread_threadStart): Fix prototype. - * private.c (_pthread_threadStart): Likewise. + (ptw32_threadStart): Fix prototype. + * private.c (ptw32_threadStart): Likewise. 1999-08-14 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -491,7 +497,7 @@ Tue Aug 17 20:00:08 1999 Mumit Khan <khan@xraylith.wisc.edu> 1999-08-12 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_threadStart): ei[] only declared if _MSC_VER. + * private.c (ptw32_threadStart): ei[] only declared if _MSC_VER. * exit.c (pthread_exit): Check for implicitly created threads to avoid raising an unhandled exception. @@ -525,10 +531,10 @@ Tue Aug 17 20:00:08 1999 Mumit Khan <khan@xraylith.wisc.edu> Pthread_exception_cancel (C++) used to identify the exception. * exit.c (pthread_exit): throw/raise an exception to return to - _pthread_threadStart() to exit the thread. _PTHREAD_EPS_EXIT (SEH) + ptw32_threadStart() to exit the thread. _PTHREAD_EPS_EXIT (SEH) and Pthread_exception_exit (C++) used to identify the exception. - * private.c (_pthread_threadStart): Add pthread_exit exception trap; + * private.c (ptw32_threadStart): Add pthread_exit exception trap; clean up and exit the thread directly rather than via pthread_exit(). Sun May 30 00:25:02 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -596,8 +602,8 @@ Sun Apr 4 11:05:57 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * sched.c (sched_yield): New function. - * condvar.c (_pthread_sem_*): Rename to sem_*; except for - _pthread_sem_timedwait which is an private function. + * condvar.c (ptw32_sem_*): Rename to sem_*; except for + ptw32_sem_timedwait which is an private function. Sat Apr 3 23:28:00 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -605,21 +611,21 @@ Sat Apr 3 23:28:00 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Fri Apr 2 11:08:50 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * implement.h (_pthread_sem_*): Remove prototypes now defined in + * implement.h (ptw32_sem_*): Remove prototypes now defined in semaphore.h. * pthread.h (sempahore.h): Include. * semaphore.h: New file for POSIX 1b semaphores. - * pthread.h (_pthread_sem_t): Change to sem_t. + * pthread.h (ptw32_sem_t): Change to sem_t. - * semaphore.c (_pthread_sem_*): Change to sem_*; these functions + * semaphore.c (ptw32_sem_*): Change to sem_*; these functions will be exported from the library; set errno on error. - John Bossom <jebossom@cognos.com> - (_pthread_sem_timedwait): Moved to private.c. + (ptw32_sem_timedwait): Moved to private.c. - * private.c (_pthread_sem_timedwait): Moved from semaphore.c; + * private.c (ptw32_sem_timedwait): Moved from semaphore.c; set errno on error. * errno.c (_errno): New file. New function. @@ -629,7 +635,7 @@ Fri Apr 2 11:08:50 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Fri Mar 26 14:11:45 1999 Ross Johnson <rpj@swan.canberra.edu.au> - * semaphore.c (_pthread_sem_timedwait): Check for negative + * semaphore.c (ptw32_sem_timedwait): Check for negative milliseconds. - Tor Lillqvist <tml@iki.fi> @@ -645,7 +651,7 @@ Wed Mar 24 11:32:07 1999 Ross Johnson <rpj@swan.canberra.edu.au> * implement.h (SE_INFORMATION): Fix values. - John Bossom <jebossom@cognos.com> - * private.c (_pthread_threadDestroy): Close the thread handle. + * private.c (ptw32_threadDestroy): Close the thread handle. - John Bossom <jebossom@cognos.com> Fri Mar 19 12:57:27 1999 Ross Johnson <rpj@swan.canberra.edu.au> @@ -654,7 +660,7 @@ Fri Mar 19 12:57:27 1999 Ross Johnson <rpj@swan.canberra.edu.au> Fri Mar 19 09:12:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_threadStart): status returns PTHREAD_CANCELED. + * private.c (ptw32_threadStart): status returns PTHREAD_CANCELED. * pthread.h (PTHREAD_CANCELED): defined. @@ -705,7 +711,7 @@ Mon Mar 8 11:18:59 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> problem of initialising the opaque critical section element in it. (PTHREAD_COND_INITIALIZER): Ditto. - * semaphore.c (_pthread_sem_timedwait): Check sem == NULL earlier. + * semaphore.c (ptw32_sem_timedwait): Check sem == NULL earlier. Sun Mar 7 12:31:14 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -717,11 +723,11 @@ Sun Mar 7 12:31:14 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> the cancel event is recognised and acted apon if both objects happen to be signaled together. - * private.c (_pthread_cond_test_init_lock): Initialise and destroy. + * private.c (ptw32_cond_test_init_lock): Initialise and destroy. - * implement.h (_pthread_cond_test_init_lock): Add extern. + * implement.h (ptw32_cond_test_init_lock): Add extern. - * global.c (_pthread_cond_test_init_lock): Add declaration. + * global.c (ptw32_cond_test_init_lock): Add declaration. * condvar.c (pthread_cond_destroy): check for valid initialised CV; flag destroyed CVs as invalid. @@ -761,7 +767,7 @@ Sat Feb 20 16:03:30 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * dll.c (DLLMain): Expand TryEnterCriticalSection support test. * mutex.c (pthread_mutex_trylock): The check for - _pthread_try_enter_critical_section == NULL should have been + ptw32_try_enter_critical_section == NULL should have been removed long ago. Fri Feb 19 16:03:30 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -824,7 +830,7 @@ Thu Feb 4 10:07:28 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Wed Feb 3 13:04:44 1999 Ross Johnson <rpj@swan.canberra.edu.au> - * cleanup.c: Rename _pthread_*_cleanup() to pthread_*_cleanup(). + * cleanup.c: Rename ptw32_*_cleanup() to pthread_*_cleanup(). * pthread.def: Ditto. @@ -844,7 +850,7 @@ Wed Feb 3 10:13:48 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Tue Feb 2 18:07:43 1999 Ross Johnson <rpj@swan.canberra.edu.au> * implement.h: Add #include <pthread.h>. - Change sem_t to _pthread_sem_t. + Change sem_t to ptw32_sem_t. Various patches by Kevin Ruland <Kevin.Ruland@anheuser-busch.com> @@ -860,7 +866,7 @@ Tue Feb 2 18:07:43 1999 Ross Johnson <rpj@swan.canberra.edu.au> * create.c (pthread_create): Set sigmask in thread. - * condvar.c: Remove #include. Change sem_* to _pthread_sem_*. + * condvar.c: Remove #include. Change sem_* to ptw32_sem_*. * attr.c: Changed #include. @@ -871,8 +877,8 @@ Fri Jan 29 11:56:28 1999 Ross Johnson <rpj@swan.canberra.edu.au> * Makefile.in (OBJS): Add semaphore.o to list. - * semaphore.c (_pthread_sem_timedwait): Move from private.c. - Rename sem_* to _pthread_sem_*. + * semaphore.c (ptw32_sem_timedwait): Move from private.c. + Rename sem_* to ptw32_sem_*. * pthread.h (pthread_cond_t): Change type of sem_t. _POSIX_SEMAPHORES no longer defined. @@ -880,12 +886,12 @@ Fri Jan 29 11:56:28 1999 Ross Johnson <rpj@swan.canberra.edu.au> * semaphore.h: Contents moved to implement.h. Removed from source tree. - * implement.h: Add semaphore function prototypes and ename all - functions to prepend '_pthread_'. They are + * implement.h: Add semaphore function prototypes and rename all + functions to prepend 'ptw32_'. They are now private to the pthreads-win32 implementation. * private.c: Change #warning. - Move _pthread_sem_timedwait() to semaphore.c. + Move ptw32_sem_timedwait() to semaphore.c. * cleanup.c: Change #warning. @@ -937,7 +943,7 @@ Fri Jan 22 14:31:59 1999 Ross Johnson <rpj@swan.canberra.edu.au> * attr.c (pthread_attr_init): Remove unused 'result'. Cast malloc return value. - * private.c (_pthread_callUserDestroyRoutines): Redo conditional + * private.c (ptw32_callUserDestroyRoutines): Redo conditional compilation. * misc.c (CancelableWait): C++ version uses 'throw'. @@ -982,7 +988,7 @@ Tue Jan 19 18:27:42 1999 Ross Johnson <rpj@swan.canberra.edu.au> (pthreadCancelableTimedWait): Just calls CancelableWait() with passed in timeout. - * private.c (_pthread_sem_timedwait): 'abstime' arg really is + * private.c (ptw32_sem_timedwait): 'abstime' arg really is absolute time. Calculate relative time to wait from current time before passing timeout to new routine pthreadCancelableTimedWait(). @@ -1020,13 +1026,13 @@ 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. + * global.c (ptw32_mutex_test_init_lock): Add. - * implement.h (_pthread_mutex_test_init_lock.): Add extern. + * implement.h (ptw32_mutex_test_init_lock.): Add extern. - * private.c (_pthread_processInitialize): Init critical section for + * private.c (ptw32_processInitialize): Init critical section for global lock used by _mutex_check_need_init(). - (_pthread_processTerminate): Ditto (:s/Init/Destroy/). + (ptw32_processTerminate): Ditto (:s/Init/Destroy/). * dll.c (dllMain): Move call to FreeLibrary() so that it is only called once when the process detaches. @@ -1062,10 +1068,10 @@ Sun Jan 17 12:01:26 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Sun Jan 17 12:01:26 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_sem_timedwait): Move from semaphore.c. + * private.c (ptw32_sem_timedwait): Move from semaphore.c. * semaphore.c : Remove redundant #includes. - (_pthread_sem_timedwait): Move to private.c. + (ptw32_sem_timedwait): Move to private.c. (sem_wait): Add missing abstime arg to pthreadCancelableWait() call. Fri Jan 15 23:38:05 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -1080,20 +1086,20 @@ Fri Jan 15 15:41:28 1999 Ross Johnson <rpj@swan.canberra.edu.au> * condvar.c (cond_timedwait): New generalised function called by both pthread_cond_wait() and pthread_cond_timedwait(). This is essentially pthread_cond_wait() renamed and modified to add the - 'abstime' arg and call the new _pthread_sem_timedwait() instead of + 'abstime' arg and call the new ptw32_sem_timedwait() instead of sem_wait(). (pthread_cond_wait): Now just calls the internal static function cond_timedwait() with an INFINITE wait. (pthread_cond_timedwait): Now implemented. Calls the internal static function cond_timedwait(). - * implement.h (_pthread_sem_timedwait): New internal function + * implement.h (ptw32_sem_timedwait): New internal function prototype. * misc.c (pthreadCancelableWait): Added new 'abstime' argument to allow shorter than INFINITE wait. - * semaphore.c (_pthread_sem_timedwait): New function for internal + * semaphore.c (ptw32_sem_timedwait): New function for internal use. This is essentially sem_wait() modified to add the 'abstime' arg and call the modified (see above) pthreadCancelableWait(). @@ -1109,11 +1115,11 @@ Thu Jan 14 14:27:13 1999 Ross Johnson <rpj@swan.canberra.edu.au> handling will not be included and thus thread cancellation, for example, will not work. - * cleanup.c (_pthread_pop_cleanup): Add #warning to compile this + * cleanup.c (ptw32_pop_cleanup): Add #warning to compile this file as C++ if using a cygwin32 environment. Perhaps the whole package should be compiled using g++ under cygwin. - * private.c (_pthread_threadStart): Change #error directive + * private.c (ptw32_threadStart): Change #error directive into #warning and bracket for __CYGWIN__ and derivative compilers. Wed Jan 13 09:34:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -1153,7 +1159,7 @@ Mon Jan 11 20:33:19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * pthread.h: Re-arrange conditional compile of pthread_cleanup-* macros. - * cleanup.c (_pthread_push_cleanup): Provide conditional + * cleanup.c (ptw32_push_cleanup): Provide conditional compile of cleanup->prev. 1999-01-11 Ben Elliston <bje@cygnus.com> @@ -1170,7 +1176,7 @@ Sat Jan 9 14:32:08 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Tue Jan 5 16:33:04 1999 Ross Johnson <rpj@swan.canberra.edu.au> - * cleanup.c (_pthread_pop_cleanup): Add C++ version of __try/__except + * cleanup.c (ptw32_pop_cleanup): Add C++ version of __try/__except block. Move trailing "}" out of #ifdef _WIN32 block left there by (rpj's) mistake. @@ -1206,11 +1212,11 @@ Tue Dec 29 13:11:16 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Now unimplemented. * tsd.c (pthread_setspecific): Rename tkAssocCreate to - _pthread_tkAssocCreate. + ptw32_tkAssocCreate. (pthread_key_delete): Rename tkAssocDestroy to - _pthread_tkAssocDestroy. + ptw32_tkAssocDestroy. - * sync.c (pthread_join): Rename threadDestroy to _pthread_threadDestroy + * sync.c (pthread_join): Rename threadDestroy to ptw32_threadDestroy * sched.c (is_attr): attr is now **attr (was *attr), so add extra NULL pointer test. @@ -1221,8 +1227,8 @@ Tue Dec 29 13:11:16 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Win32 thread Handle element name to match John Bossom's version. (pthread_getschedparam): Ditto. - * private.c (_pthread_threadDestroy): Rename call to - callUserDestroyRoutines() as _pthread_callUserDestroyRoutines() + * private.c (ptw32_threadDestroy): Rename call to + callUserDestroyRoutines() as ptw32_callUserDestroyRoutines() * misc.c: Add #include "implement.h". @@ -1232,7 +1238,7 @@ Tue Dec 29 13:11:16 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Remove pthread_atfork() and fork() with #if 0/#endif. * create.c (pthread_create): Rename threadStart and threadDestroy calls - to _pthread_threadStart and _pthread_threadDestroy. + to ptw32_threadStart and ptw32_threadDestroy. * implement.h: Rename "detachedstate" to "detachstate". @@ -1312,14 +1318,14 @@ Mon Dec 7 09:44:40 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * create.c (pthread_create): Replaced by John Bossom's version. - * private.c (_pthread_processInitialize): New by John Bossom. - (_pthread_processTerminate): Non-public function by John Bossom. - (_pthread_threadStart): Non-public function by John Bossom. - (_pthread_threadDestroy): Non-public function by John Bossom. - (_pthread_cleanupStack): Non-public function by John Bossom. - (_pthread_tkAssocCreate): Non-public function by John Bossom. - (_pthread_tkAssocDestroy): Non-public function by John Bossom. - (_pthread_callUserDestroyRoutines): Non-public function by John Bossom. + * private.c (ptw32_processInitialize): New by John Bossom. + (ptw32_processTerminate): Non-public function by John Bossom. + (ptw32_threadStart): Non-public function by John Bossom. + (ptw32_threadDestroy): Non-public function by John Bossom. + (ptw32_cleanupStack): Non-public function by John Bossom. + (ptw32_tkAssocCreate): Non-public function by John Bossom. + (ptw32_tkAssocDestroy): Non-public function by John Bossom. + (ptw32_callUserDestroyRoutines): Non-public function by John Bossom. * implement.h: Added John Bossom's non-API structures and declarations. @@ -1330,20 +1336,20 @@ Mon Dec 7 09:44:40 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * dll.c (DLLmain): Replaced by John Bossom's version. * dll.c (PthreadsEntryPoint): Re-applied Anders Norlander's patch:- - Initialize _pthread_try_enter_critical_section at startup + Initialize ptw32_try_enter_critical_section at startup and release kernel32 handle when DLL is being unloaded. Sun Dec 6 21:54:35 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * buildlib.bat: Fix args to CL when building the .DLL - * cleanup.c (_pthread_destructor_run_all): Fix TSD key management. + * cleanup.c (ptw32_destructor_run_all): Fix TSD key management. This is a tidy-up before TSD and Thread management is completely replaced by John Bossom's code. * tsd.c (pthread_key_create): Fix TSD key management. - * global.c (_pthread_key_virgin_next): Initialise. + * global.c (ptw32_key_virgin_next): Initialise. * build.bat: New DOS script to compile and link a pthreads app using Microsoft's CL compiler linker. @@ -1353,15 +1359,15 @@ Sun Dec 6 21:54:35 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> 1998-12-05 Anders Norlander <anorland@hem2.passagen.se> - * implement.h (_pthread_try_enter_critical_section): New extern - * dll.c (_pthread_try_enter_critical_section): New pointer to + * implement.h (ptw32_try_enter_critical_section): New extern + * dll.c (ptw32_try_enter_critical_section): New pointer to TryEnterCriticalSection if it exists; otherwise NULL. * dll.c (PthreadsEntryPoint): - Initialize _pthread_try_enter_critical_section at startup + Initialize ptw32_try_enter_critical_section at startup and release kernel32 handle when DLL is being unloaded. * mutex.c (pthread_mutex_trylock): Replaced check for NT with - a check if _pthread_try_enter_critical_section is valid - pointer to a function. Call _pthread_try_enter_critical_section + a check if ptw32_try_enter_critical_section is valid + pointer to a function. Call ptw32_try_enter_critical_section instead of TryEnterCriticalSection to avoid errors on Win95. Thu Dec 3 13:32:00 1998 Ross Johnson <rpj@ise.canberra.edu.au> @@ -1370,7 +1376,7 @@ Thu Dec 3 13:32:00 1998 Ross Johnson <rpj@ise.canberra.edu.au> Sun Nov 15 21:24:06 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * cleanup.c (_pthread_destructor_run_all): Declare missing void * arg. + * cleanup.c (ptw32_destructor_run_all): Declare missing void * arg. Fixup CVS merge conflicts. 1998-10-30 Ben Elliston <bje@cygnus.com> @@ -1380,7 +1386,7 @@ Sun Nov 15 21:24:06 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Fri Oct 30 15:15:50 1998 Ross Johnson <rpj@swan.canberra.edu.au> - * cleanup.c (_pthread_handler_push): Fixed bug appending new + * cleanup.c (ptw32_handler_push): Fixed bug appending new handler to list reported by Peter Slacik <Peter.Slacik@leibinger.freinet.de>. (new_thread): Rename poorly named local variable to @@ -1396,10 +1402,10 @@ Fri Oct 23 00:08:09 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * implement.h (_PTHREAD_TSD_KEY_REUSE): Add enum. - * private.c (_pthread_delete_thread): Add call to - _pthread_destructor_run_all() to clean up the threads keys. + * private.c (ptw32_delete_thread): Add call to + ptw32_destructor_run_all() to clean up the threads keys. - * cleanup.c (_pthread_destructor_run_all): Check for no more dirty + * cleanup.c (ptw32_destructor_run_all): Check for no more dirty keys to run destructors on. Assume that the destructor call always succeeds and set the key value to NULL. @@ -1409,19 +1415,19 @@ Thu Oct 22 21:44:44 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> (pthread_key_create): Ditto. (pthread_key_delete): Ditto. - * implement.h (struct _pthread_tsd_key): Add status member. + * implement.h (struct ptw32_tsd_key): Add status member. * tsd.c: Add description of pthread_key_delete() from the standard as a comment. Fri Oct 16 17:38:47 1998 Ross Johnson <rpj@swan.canberra.edu.au> - * cleanup.c (_pthread_destructor_run_all): Fix and improve + * cleanup.c (ptw32_destructor_run_all): Fix and improve stepping through the key table. Thu Oct 15 14:05:01 1998 Ross Johnson <rpj@swan.canberra.edu.au> - * private.c (_pthread_new_thread): Remove init of destructorstack. + * private.c (ptw32_new_thread): Remove init of destructorstack. No longer an element of pthread_t. * tsd.c (pthread_setspecific): Fix type declaration and cast. @@ -1431,34 +1437,34 @@ Thu Oct 15 14:05:01 1998 Ross Johnson <rpj@swan.canberra.edu.au> Thu Oct 15 11:53:21 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * global.c (_pthread_tsd_key_table): Fix declaration. + * global.c (ptw32_tsd_key_table): Fix declaration. - * implement.h(_pthread_TSD_keys_TlsIndex): Add missing extern. - (_pthread_tsd_mutex): Ditto. + * implement.h(ptw32_TSD_keys_TlsIndex): Add missing extern. + (ptw32_tsd_mutex): Ditto. - * create.c (_pthread_start_call): Fix "keys" array declaration. + * create.c (ptw32_start_call): Fix "keys" array declaration. Add comment. * tsd.c (pthread_setspecific): Fix type declaration and cast. (pthread_getspecific): Ditto. - * cleanup.c (_pthread_destructor_run_all): Declare missing loop + * cleanup.c (ptw32_destructor_run_all): Declare missing loop counter. Wed Oct 14 21:09:24 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_new_thread): Increment _pthread_threads_count. - (_pthread_delete_thread): Decrement _pthread_threads_count. + * private.c (ptw32_new_thread): Increment ptw32_threads_count. + (ptw32_delete_thread): Decrement ptw32_threads_count. Remove some comments. - * exit.c (_pthread_exit): : Fix two pthread_mutex_lock() calls that + * exit.c (ptw32_exit): : Fix two pthread_mutex_lock() calls that should have been pthread_mutex_unlock() calls. - (_pthread_vacuum): Remove call to _pthread_destructor_pop_all(). + (ptw32_vacuum): Remove call to ptw32_destructor_pop_all(). * create.c (pthread_create): Fix two pthread_mutex_lock() calls that should have been pthread_mutex_unlock() calls. - * global.c (_pthread_tsd_mutex): Add mutex for TSD operations. + * global.c (ptw32_tsd_mutex): Add mutex for TSD operations. * tsd.c (pthread_key_create): Add critical section. (pthread_setspecific): Ditto. @@ -1470,24 +1476,24 @@ Wed Oct 14 21:09:24 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Mon Oct 12 00:00:44 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * implement.h (_pthread_tsd_key_table): New. + * implement.h (ptw32_tsd_key_table): New. - * create.c (_pthread_start_call): Initialise per-thread TSD keys + * create.c (ptw32_start_call): Initialise per-thread TSD keys to NULL. * misc.c (pthread_once): Correct typo in comment. - * implement.h (_pthread_destructor_push): Remove. - (_pthread_destructor_pop): Remove. - (_pthread_destructor_run_all): Rename from _pthread_destructor_pop_all. + * implement.h (ptw32_destructor_push): Remove. + (ptw32_destructor_pop): Remove. + (ptw32_destructor_run_all): Rename from ptw32_destructor_pop_all. (_PTHREAD_TSD_KEY_DELETED): Add enum. (_PTHREAD_TSD_KEY_INUSE): Add enum. - * cleanup.c (_pthread_destructor_push): Remove. - (_pthread_destructor_pop): Remove. - (_pthread_destructor_run_all): Totally revamped TSD. + * cleanup.c (ptw32_destructor_push): Remove. + (ptw32_destructor_pop): Remove. + (ptw32_destructor_run_all): Totally revamped TSD. - * dll.c (_pthread_TSD_keys_TlsIndex): Initialise. + * dll.c (ptw32_TSD_keys_TlsIndex): Initialise. * tsd.c (pthread_setspecific): Totally revamped TSD. (pthread_getspecific): Ditto. @@ -1496,14 +1502,14 @@ Mon Oct 12 00:00:44 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Sun Oct 11 22:44:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * global.c (_pthread_tsd_key_table): Add new global. + * global.c (ptw32_tsd_key_table): Add new global. - * implement.h (_pthread_tsd_key_t and struct _pthread_tsd_key): + * implement.h (ptw32_tsd_key_t and struct ptw32_tsd_key): Add. (struct _pthread): Remove destructorstack. - * cleanup.c (_pthread_destructor_run_all): Rename from - _pthread_destructor_pop_all. The key destructor stack was made + * cleanup.c (ptw32_destructor_run_all): Rename from + ptw32_destructor_pop_all. The key destructor stack was made global rather than per-thread. No longer removes destructor nodes from the stack. Comments updated. @@ -1593,7 +1599,7 @@ Mon Oct 5 14:25:08 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * config.h.in: Regenerate. - * create.c (_pthread_start_call): Add STDCALL prefix. + * create.c (ptw32_start_call): Add STDCALL prefix. * mutex.c (pthread_mutex_init): Correct function signature. @@ -1679,30 +1685,30 @@ Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au> and LeaveCriticalSection() calls to pass address-of lock. * fork.c (pthread_atfork): Typecast (void (*)(void *)) funcptr - in each _pthread_handler_push() call. + in each ptw32_handler_push() call. - * exit.c (_pthread_exit): Fix attr arg in + * exit.c (ptw32_exit): Fix attr arg in pthread_attr_getdetachstate() call. - * private.c (_pthread_new_thread): Typecast (HANDLE) NULL. - (_pthread_delete_thread): Ditto. + * private.c (ptw32_new_thread): Typecast (HANDLE) NULL. + (ptw32_delete_thread): Ditto. * implement.h: (_PTHREAD_MAX_THREADS): Add define. This keeps changing in an attempt to make thread administration data types opaque and cleanup DLL startup. * dll.c (PthreadsEntryPoint): - (_pthread_virgins): Remove malloc() and free() calls. - (_pthread_reuse): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + (ptw32_virgins): Remove malloc() and free() calls. + (ptw32_reuse): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. * global.c (_POSIX_THREAD_THREADS_MAX): Initialise with _PTHREAD_MAX_THREADS. - (_pthread_virgins): Ditto. - (_pthread_reuse): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + (ptw32_virgins): Ditto. + (ptw32_reuse): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. * create.c (pthread_create): Typecast (HANDLE) NULL. Typecast (unsigned (*)(void *)) start_routine. @@ -1712,14 +1718,14 @@ Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au> (pthread_cond_destroy): Add address-of operator & to arg 1 of pthread_mutex_destroy() call. - * cleanup.c (_pthread_destructor_pop_all): Add (int) cast to + * cleanup.c (ptw32_destructor_pop_all): Add (int) cast to pthread_getspecific() arg. - (_pthread_destructor_pop): Add (void *) cast to "if" conditional. - (_pthread_destructor_push): Add (void *) cast to - _pthread_handler_push() "key" arg. + (ptw32_destructor_pop): Add (void *) cast to "if" conditional. + (ptw32_destructor_push): Add (void *) cast to + ptw32_handler_push() "key" arg. (malloc.h): Add include. - * implement.h (_pthread_destructor_pop): Add prototype. + * implement.h (ptw32_destructor_pop): Add prototype. * tsd.c (implement.h): Add include. @@ -1749,59 +1755,59 @@ Thu Aug 6 15:19:22 1998 Ross Johnson <rpj@swan.canberra.edu.au> Tue Aug 4 16:57:58 1998 Ross Johnson <rpj@swan.canberra.edu.au> - * private.c (_pthread_delete_thread): Fix typo. Add missing ';'. + * private.c (ptw32_delete_thread): Fix typo. Add missing ';'. - * global.c (_pthread_virgins): Change types from pointer to + * global.c (ptw32_virgins): Change types from pointer to array pointer. - (_pthread_reuse): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + (ptw32_reuse): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. - * implement.h(_pthread_virgins): Change types from pointer to + * implement.h(ptw32_virgins): Change types from pointer to array pointer. - (_pthread_reuse): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + (ptw32_reuse): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. - * private.c (_pthread_delete_thread): Fix "entry" should be "thread". + * private.c (ptw32_delete_thread): Fix "entry" should be "thread". - * misc.c (pthread_self): Add extern for _pthread_threadID_TlsIndex. + * misc.c (pthread_self): Add extern for ptw32_threadID_TlsIndex. * global.c: Add comment. * misc.c (pthread_once): Fix member -> dereferences. - Change _pthread_once_flag to once_control->flag in "if" test. + Change ptw32_once_flag to once_control->flag in "if" test. Tue Aug 4 00:09:30 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * implement.h(_pthread_virgins): Add extern. - (_pthread_virgin_next): Ditto. - (_pthread_reuse): Ditto. - (_pthread_reuse_top): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + * implement.h(ptw32_virgins): Add extern. + (ptw32_virgin_next): Ditto. + (ptw32_reuse): Ditto. + (ptw32_reuse_top): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. - * global.c (_pthread_virgins): Changed from array to pointer. + * global.c (ptw32_virgins): Changed from array to pointer. Storage allocation for the array moved into dll.c. - (_pthread_reuse): Ditto. - (_pthread_win32handle_map): Ditto. - (_pthread_threads_mutex_table): Ditto. + (ptw32_reuse): Ditto. + (ptw32_win32handle_map): Ditto. + (ptw32_threads_mutex_table): Ditto. * dll.c (PthreadsEntryPoint): Set up thread admin storage when DLL is loaded. * fork.c (pthread_atfork): Fix function pointer arg to all - _pthread_handler_push() calls. Change "arg" arg to NULL in child push. + ptw32_handler_push() calls. Change "arg" arg to NULL in child push. * exit.c: Add windows.h and process.h includes. - (_pthread_exit): Add local detachstate declaration. - (_pthread_exit): Fix incorrect name for pthread_attr_getdetachstate(). + (ptw32_exit): Add local detachstate declaration. + (ptw32_exit): Fix incorrect name for pthread_attr_getdetachstate(). * pthread.h (_POSIX_THREAD_ATTR_STACKSIZE): Move from global.c (_POSIX_THREAD_ATTR_STACKADDR): Ditto. * create.c (pthread_create): Fix #if should be #ifdef. - (_pthread_start_call): Remove usused variables. + (ptw32_start_call): Remove usused variables. * process.h: Create. @@ -1816,7 +1822,7 @@ Mon Aug 3 21:19:57 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> (cond_wait): Fix typo - cv was ev. (pthread_cond_broadcast): Fix two identical typos. - * cleanup.c (_pthread_destructor_pop_all): Remove _ prefix from + * cleanup.c (ptw32_destructor_pop_all): Remove _ prefix from PTHREAD_DESTRUCTOR_ITERATIONS. * pthread.h: Move _POSIX_* values into posix.h @@ -1836,7 +1842,7 @@ Mon Aug 3 21:19:57 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * implement.h (_PTHREAD_HANDLER_POP_LIFO): Remove definition. (_PTHREAD_HANDLER_POP_FIFO): Ditto. (_PTHREAD_VALID): Add missing newline escape (\). - (_pthread_handler_node): Make element "next" a pointer. + (ptw32_handler_node): Make element "next" a pointer. 1998-08-02 Ben Elliston <bje@cygnus.com> @@ -1861,11 +1867,11 @@ Sun Aug 2 19:03:42 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Fri Jul 31 14:00:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> - * cleanup.c (_pthread_destructor_pop): Implement. Removes + * cleanup.c (ptw32_destructor_pop): Implement. Removes destructors associated with a key without executing them. - (_pthread_destructor_pop_all): Add FIXME comment. + (ptw32_destructor_pop_all): Add FIXME comment. - * tsd.c (pthread_key_delete): Add call to _pthread_destructor_pop(). + * tsd.c (pthread_key_delete): Add call to ptw32_destructor_pop(). Fri Jul 31 00:05:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -1873,16 +1879,16 @@ Fri Jul 31 00:05:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> the destructor routine with the key. (pthread_key_delete): Add FIXME comment. - * exit.c (_pthread_vacuum): Add call to - _pthread_destructor_pop_all(). + * exit.c (ptw32_vacuum): Add call to + ptw32_destructor_pop_all(). - * implement.h (_pthread_handler_pop_all): Add prototype. - (_pthread_destructor_pop_all): Ditto. + * implement.h (ptw32_handler_pop_all): Add prototype. + (ptw32_destructor_pop_all): Ditto. - * cleanup.c (_pthread_destructor_push): Implement. This is just a - call to _pthread_handler_push(). - (_pthread_destructor_pop_all): Implement. This is significantly - different to _pthread_handler_pop_all(). + * cleanup.c (ptw32_destructor_push): Implement. This is just a + call to ptw32_handler_push(). + (ptw32_destructor_pop_all): Implement. This is significantly + different to ptw32_handler_pop_all(). * Makefile (SRCS): Create. Preliminary. @@ -1902,19 +1908,19 @@ Fri Jul 31 00:05:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Thu Jul 30 23:12:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * implement.h: Remove _pthread_find_entry() prototype. + * implement.h: Remove ptw32_find_entry() prototype. * private.c: Extend comments. - Remove _pthread_find_entry() - no longer needed. + Remove ptw32_find_entry() - no longer needed. - * create.c (_pthread_start_call): Add call to TlsSetValue() to + * create.c (ptw32_start_call): Add call to TlsSetValue() to store the thread ID. * dll.c (PthreadsEntryPoint): Implement. This is called whenever a process loads the DLL. Used to initialise thread local storage. - * implement.h: Add _pthread_threadID_TlsIndex. + * implement.h: Add ptw32_threadID_TlsIndex. Add ()s around _PTHREAD_VALID expression. * misc.c (pthread_self): Re-implement using Win32 TLS to store @@ -1923,13 +1929,13 @@ Thu Jul 30 23:12:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Wed Jul 29 11:39:03 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * private.c: Corrections in comments. - (_pthread_new_thread): Alter "if" flow to be more natural. + (ptw32_new_thread): Alter "if" flow to be more natural. - * cleanup.c (_pthread_handler_push): Same as below. + * cleanup.c (ptw32_handler_push): Same as below. * create.c (pthread_create): Same as below. - * private.c (_pthread_new_thread): Rename "new" to "new_thread". + * private.c (ptw32_new_thread): Rename "new" to "new_thread". Since when has a C programmer been required to know C++? Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> @@ -1937,7 +1943,7 @@ Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> * implement.h: Add _PTHREAD_VALID macro. * sync.c (pthread_join): Modify to use the new thread - type and _pthread_delete_thread(). Rename "target" to "thread". + type and ptw32_delete_thread(). Rename "target" to "thread". Remove extra local variable "target". (pthread_detach): Ditto. @@ -1948,15 +1954,15 @@ Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> type. (pthread_getschedparam): Ditto. - * private.c (_pthread_find_thread): Fix return type and arg. + * private.c (ptw32_find_thread): Fix return type and arg. * implement.h: Remove _PTHREAD_YES and _PTHREAD_NO. - (_pthread_new_thread): Add prototype. - (_pthread_find_thread): Ditto. - (_pthread_delete_thread): Ditto. - (_pthread_new_thread_entry): Remove prototype. - (_pthread_find_thread_entry): Ditto. - (_pthread_delete_thread_entry): Ditto. + (ptw32_new_thread): Add prototype. + (ptw32_find_thread): Ditto. + (ptw32_delete_thread): Ditto. + (ptw32_new_thread_entry): Remove prototype. + (ptw32_find_thread_entry): Ditto. + (ptw32_delete_thread_entry): Ditto. ( _PTHREAD_NEW, _PTHREAD_INUSE, _PTHREAD_EXITED, _PTHREAD_REUSE): Add. @@ -1970,36 +1976,36 @@ Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au> * exit.c (pthread_exit): Fix pthread_this should be pthread_self. * cancel.c (pthread_setcancelstate): Change - _pthread_threads_thread_t * to pthread_t and init with + ptw32_threads_thread_t * to pthread_t and init with pthread_this(). (pthread_setcanceltype): Ditto. - * exit.c (_pthread_exit): Add new pthread_t arg. - Rename _pthread_delete_thread_entry to _pthread_delete_thread. + * exit.c (ptw32_exit): Add new pthread_t arg. + Rename ptw32_delete_thread_entry to ptw32_delete_thread. Rename "us" to "thread". - (pthread_exit): Call _pthread_exit with added thread arg. + (pthread_exit): Call ptw32_exit with added thread arg. - * create.c (_pthread_start_call): Insert missing ")". - Add "us" arg to _pthread_exit() call. + * create.c (ptw32_start_call): Insert missing ")". + Add "us" arg to ptw32_exit() call. (pthread_create): Modify to use new thread allocation scheme. * private.c: Added detailed explanation of the new thread allocation scheme. - (_pthread_new_thread): Totally rewritten to use + (ptw32_new_thread): Totally rewritten to use new thread allocation scheme. - (_pthread_delete_thread): Ditto. - (_pthread_find_thread): Obsolete. + (ptw32_delete_thread): Ditto. + (ptw32_find_thread): Obsolete. Mon Jul 27 17:46:37 1998 Ross Johnson <rpj@swan.canberra.edu.au> * create.c (pthread_create): Start of rewrite. Not completed yet. - * private.c (_pthread_new_thread_entry): Start of rewrite. Not + * private.c (ptw32_new_thread_entry): Start of rewrite. Not complete. - * implement.h (_pthread_threads_thread): Rename, remove thread + * implement.h (ptw32_threads_thread): Rename, remove thread member, add win32handle and ptstatus members. - (_pthread_t): Add. + (ptw32_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 @@ -2008,40 +2014,40 @@ Mon Jul 27 17:46:37 1998 Ross Johnson <rpj@swan.canberra.edu.au> Mon Jul 27 00:20:37 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_delete_thread_entry): Destroy the thread + * private.c (ptw32_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. + * exit.c (ptw32_exit): Fix incorrect check for detachedstate. - * implement.h (_pthread_call_t): Remove env member. + * implement.h (ptw32_call_t): Remove env member. Sun Jul 26 13:06:12 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * implement.h (_pthread_new_thread_entry): Fix prototype. - (_pthread_find_thread_entry): Ditto. - (_pthread_delete_thread_entry): Ditto. - (_pthread_exit): Add prototype. + * implement.h (ptw32_new_thread_entry): Fix prototype. + (ptw32_find_thread_entry): Ditto. + (ptw32_delete_thread_entry): Ditto. + (ptw32_exit): Add prototype. - * exit.c (_pthread_exit): New function. Called from pthread_exit() - and _pthread_start_call() to exit the thread. It allows an extra + * exit.c (ptw32_exit): New function. Called from pthread_exit() + and ptw32_start_call() to exit the thread. It allows an extra argument which is the return code passed to _endthreadex(). - (_pthread_exit): Move thread entry delete call from _pthread_vacuum() + (ptw32_exit): Move thread entry delete call from ptw32_vacuum() into here. Add more explanation of thread entry deletion. - (_pthread_exit): Clarify comment. + (ptw32_exit): Clarify comment. - * create.c (_pthread_start_call): Change pthread_exit() call to - _pthread_exit() call. + * create.c (ptw32_start_call): Change pthread_exit() call to + ptw32_exit() call. - * exit.c (_pthread_vacuum): Add thread entry deletion code - moved from _pthread_start_call(). See next item. + * exit.c (ptw32_vacuum): Add thread entry deletion code + moved from ptw32_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 + * create.c (ptw32_start_call): Remove setjmp() call and move cleanup code out. Call pthread_exit(NULL) to terminate the thread. 1998-07-26 Ben Elliston <bje@cygnus.com> @@ -2056,18 +2062,18 @@ Sun Jul 26 13:06:12 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Sun Jul 26 00:09:59 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * sync.c: Rename all instances of _pthread_count_mutex to - _pthread_table_mutex. + * sync.c: Rename all instances of ptw32_count_mutex to + ptw32_table_mutex. - * implement.h: Rename _pthread_count_mutex to - _pthread_table_mutex. + * implement.h: Rename ptw32_count_mutex to + ptw32_table_mutex. - * global.c: Rename _pthread_count_mutex to - _pthread_table_mutex. + * global.c: Rename ptw32_count_mutex to + ptw32_table_mutex. * create.c (pthread_create): Add critical sections. - (_pthread_start_call): Rename _pthread_count_mutex to - _pthread_table_mutex. + (ptw32_start_call): Rename ptw32_count_mutex to + ptw32_table_mutex. * cancel.c (pthread_setcancelstate): Fix indirection bug and rename "this" to "us". @@ -2102,22 +2108,22 @@ Sun Jul 26 00:09:59 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> 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. + * private.c (ptw32_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 + (ptw32_new_thread_entry): Ditto. + (ptw32_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". + (ptw32_new_thread_entry): Rename "this" to "new". + (ptw32_find_thread_entry): Rename "this" to "entry". + (ptw32_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 + * create.c (ptw32_start_call): Mutexes changed to + ptw32_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 + * implement.h (ptw32_threads_thread): Move cancelstate and canceltype members out of pthread_attr_t into here. * fork.c (fork): Add comment. @@ -2128,7 +2134,7 @@ Sat Jul 25 23:16:51 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Sat Jul 25 00:00:13 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * create.c (_pthread_start_call): Set thread priority. Ensure our + * create.c (ptw32_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 @@ -2142,28 +2148,28 @@ Sat Jul 25 00:00:13 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * implement.h (_PTHREAD_THREADS_TABLE_INDEX): Add. - * exit.c (_pthread_vacuum): Fix incorrect args to - _pthread_handler_pop_all() calls. + * exit.c (ptw32_vacuum): Fix incorrect args to + ptw32_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. + * global.c (ptw32_threads_mutex_table): Add. - * implement.h (_pthread_once_flag): Remove. - (_pthread_once_lock): Ditto. - (_pthread_threads_mutex_table): Add. + * implement.h (ptw32_once_flag): Remove. + (ptw32_once_lock): Ditto. + (ptw32_threads_mutex_table): Add. - * global.c (_pthread_once_flag): Remove. - (_pthread_once_lock): Ditto. + * global.c (ptw32_once_flag): Remove. + (ptw32_once_lock): Ditto. * sync.c (pthread_join): Fix tests involving new return value - from _pthread_find_thread_entry(). + from ptw32_find_thread_entry(). (pthread_detach): Ditto. - * private.c (_pthread_find_thread_entry): Failure return code + * private.c (ptw32_find_thread_entry): Failure return code changed from -1 to NULL. Fri Jul 24 23:09:33 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -2185,7 +2191,7 @@ Fri Jul 24 21:13:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * exit.c (pthread_exit): Add comment explaining the longjmp(). - * implement.h (_pthread_threads_thread_t): New member cancelthread. + * implement.h (ptw32_threads_thread_t): New member cancelthread. (_PTHREAD_YES): Define. (_PTHREAD_NO): Define. (RND_SIZEOF): Remove. @@ -2221,17 +2227,17 @@ Fri Jul 24 16:33:17 1998 Ross Johnson <rpj@swan.canberra.edu.au> and join calls to the child fork. Add #includes. - * implement.h: (_pthread_handler_push): Fix return type and stack arg + * implement.h: (ptw32_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. + (ptw32_handler_pop): Fix stack arg type in prototype. + (ptw32_handler_pop_all): Fix stack arg type in prototype. - * cleanup.c (_pthread_handler_push): Change return type to int and + * cleanup.c (ptw32_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() + * create.c (ptw32_start_call): Add call to Win32 CloseHandle() if thread is detached. 1998-07-24 Ben Elliston <bje@cygnus.com> @@ -2244,22 +2250,22 @@ Fri Jul 24 03:00:25 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * sync.c (pthread_join): Save valueptr arg in joinvalueptr for pthread_exit() to use. - * private.c (_pthread_new_thread_entry): Initialise joinvalueptr to + * private.c (ptw32_new_thread_entry): Initialise joinvalueptr to NULL. - * create.c (_pthread_start_call): Rewrite to facilitate joins. + * create.c (ptw32_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 + * implement.h (ptw32_threads_thread): New member void ** joinvalueptr. - (_pthread_call_t): New member jmpbuf env. + (ptw32_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(). + ptw32_start_call(). * create.c (pthread_create): Ensure values of new attribute members are copied to the thread attribute object. @@ -2279,7 +2285,7 @@ Fri Jul 24 00:21:21 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> (pthread_detach): Implement. After checking for a valid and joinable thread, it's still a no-op. - * private.c (_pthread_find_thread_entry): Bug prevented returning + * private.c (ptw32_find_thread_entry): Bug prevented returning an error value in some cases. * attr.c (pthread_attr_setdetachedstate): Implement. @@ -2342,18 +2348,18 @@ Fri Jul 24 00:21:21 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> Fri Jul 24 00:21:21 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * create.c (pthread_create): Arg to _pthread_new_thread_entry() + * create.c (pthread_create): Arg to ptw32_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 + * private.c (ptw32_new_thread_entry): ptw32_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 + (ptw32_find_thread_entry): Ditto + (ptw32_delete_thread_entry): Ditto Thu Jul 23 23:25:30 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> @@ -2366,36 +2372,36 @@ Thu Jul 23 23:25:30 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * 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. + * cleanup.c (ptw32_handler_push): Simplify args. Restructure. + (ptw32_handler_pop): Simplify args. Restructure. + (ptw32_handler_pop_all): Simplify args. Restructure. Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * 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. + * private.c (ptw32_find_thread_entry): Changes to return type + to support leaner ptw32_threads_table[] which now only stores + ptw32_thread_thread_t *. + (ptw32_new_thread_entry): Internal changes. + (ptw32_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. + Added destructor and atfork stacks to ptw32_threads_thread_t. - * cleanup.c (_pthread_handler_push, _pthread_handler_pop, - _pthread_handler_pop_all): Renamed cleanup push and pop routines + * cleanup.c (ptw32_handler_push, ptw32_handler_pop, + ptw32_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 + * create.c (ptw32_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() + * exit.c (ptw32_vacuum): New function contains code from + pthread_exit() that we need in the new ptw32_start_call() as well. * implement.h: Various additions and minor changes. @@ -2409,12 +2415,12 @@ Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * create.c (pthread_create): More clean up. - * private.c (_pthread_find_thread_entry): Implement. - (_pthread_delete_thread_entry): Implement. - (_pthread_new_thread_entry): Implement. + * private.c (ptw32_find_thread_entry): Implement. + (ptw32_delete_thread_entry): Implement. + (ptw32_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. + They replace ptw32_getthreadindex() which was removed. * exit.c (pthread_exit): Changed to use the new code above. @@ -2433,22 +2439,22 @@ Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> (remove_attr): Likewise. (insert_attr): Likewise. - * implement.h (_pthread_mutexattr_t): Moved to a public definition + * implement.h (ptw32_mutexattr_t): Moved to a public definition in pthread.h. There was little gain in hiding these details. - (_pthread_condattr_t): Likewise. - (_pthread_attr_t): Likewise. + (ptw32_condattr_t): Likewise. + (ptw32_attr_t): Likewise. * pthread.h (pthread_atfork): Add function prototype. (pthread_attr_t): Moved here from implement.h. * fork.c (pthread_atfork): Preliminary implementation. - (_pthread_fork): Likewise. + (ptw32_fork): Likewise. Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * cleanup.c (_pthread_cleanup_push): Implement. - (_pthread_cleanup_pop): Implement. - (_pthread_do_cancellation): Implement. + * cleanup.c (ptw32_cleanup_push): Implement. + (ptw32_cleanup_pop): Implement. + (ptw32_do_cancellation): Implement. These are private to the implementation. The real cleanup functions are macros. See below. @@ -2465,7 +2471,7 @@ Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> up to multiple of DWORD. Add function prototypes. - * private.c (_pthread_getthreadindex): "*thread" should have been + * private.c (ptw32_getthreadindex): "*thread" should have been "thread". Detect empty slot fail condition. 1998-07-20 Ben Elliston <bje@cygnus.com> @@ -2474,21 +2480,21 @@ Wed Jul 22 00:16:22 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> flag and mutex--make `pthread_once_t' contain these elements in their structure. The earlier version had incorrect semantics. - * pthread.h (_pthread_once_flag): Add new variable. Remove. - (_pthread_once_lock): Add new mutex lock to ensure integrity of - access to _pthread_once_flag. Remove. + * pthread.h (ptw32_once_flag): Add new variable. Remove. + (ptw32_once_lock): Add new mutex lock to ensure integrity of + access to ptw32_once_flag. Remove. (pthread_once): Add function prototype. (pthread_once_t): Define this type. Mon Jul 20 02:31:05 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> - * private.c (_pthread_getthreadindex): Implement. + * private.c (ptw32_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 + * implement.h: Add ptw32_cleanup_stack_t, ptw32_cleanup_node_t and _PTHREAD_HASH_INDEX. * exit.c (pthread_exit): Begin work on cleanup and de-allocate @@ -2502,10 +2508,10 @@ Mon Jul 20 02:31:05 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> 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. + * implement.h: Rename pthreads_thread_count to ptw32_threads_count. + Create ptw32_threads_thread_t struct to keep thread specific data. - * create.c: Rename pthreads_thread_count to _pthread_threads_count. + * create.c: Rename pthreads_thread_count to ptw32_threads_count. (pthread_create): Handle errors from CreateThread(). 1998-07-19 Ben Elliston <bje@cygnus.com> @@ -2554,7 +2560,7 @@ Sun Jul 19 16:26:23 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> that the mutex contained withing the pthread_cond_t structure will be a critical section. Use our new POSIX type! - * implement.h (_pthread_condattr_t): Remove shared attribute. + * implement.h (ptw32_condattr_t): Remove shared attribute. 1998-07-17 Ben Elliston <bje@cygnus.com> @@ -2564,7 +2570,7 @@ Sun Jul 19 16:26:23 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> (pthread_mutex_t): Use a Win32 CRITICAL_SECTION type for better performance. - * implement.h (_pthread_mutexattr_t): Remove shared attribute. + * implement.h (ptw32_mutexattr_t): Remove shared attribute. * mutex.c (pthread_mutexattr_setpshared): This optional function is no longer supported, since we want to implement POSIX mutex @@ -2622,8 +2628,8 @@ Mon Jul 13 01:09:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * implement.h (PTHREAD_THREADS_MAX): Remove trailing semicolon. (PTHREAD_STACK_MIN): Specify; needs confirming. - (_pthread_attr_t): Define this type. - (_pthread_condattr_t): Likewise. + (ptw32_attr_t): Define this type. + (ptw32_condattr_t): Likewise. * pthread.h (pthread_mutex_t): Define this type. (pthread_condattr_t): Likewise. @@ -2644,7 +2650,7 @@ Mon Jul 13 01:09:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> 1998-07-12 Ben Elliston <bje@cygnus.com> - * implement.h (_pthread_mutexattr_t): Define this implementation + * implement.h (ptw32_mutexattr_t): Define this implementation internal type. Application programmers only see a mutex attribute object as a void pointer. |