home *** CD-ROM | disk | FTP | other *** search
/ Game Programming - All in One (3rd Edition) / game_prog_all_in_one_3rd_ed.iso / pthread / docs / ChangeLog < prev    next >
Encoding:
Text File  |  2003-09-14  |  147.1 KB  |  4,093 lines

  1. 2003-09-14  Ross Johnson  <ross@callisto.canberra.edu.au>
  2.  
  3.     * pthread_setschedparam.c (pthread_setschedparam): Attempt to map
  4.     all priority levels between max and min (as returned by
  5.     sched_get_priority_min/max) to reasonable Win32 priority levels - i.e.
  6.     levels between THREAD_PRIORITY_LOWEST/IDLE to THREAD_PRIORITY_LOWEST and
  7.     between THREAD_PRIORITY_HIGHEST/TIME_CRITICAL to THREAD_PRIORITY_HIGHEST
  8.     while others remain unchanged; record specified thread priority level
  9.     for return by pthread_getschedparam.
  10.  
  11.     Note that, previously, specified levels not matching Win32 priority levels
  12.     would silently leave the current thread priority unaltered.
  13.  
  14.     * pthread_getschedparam.c (pthread_getschedparam): Return the priority
  15.     level specified by the latest pthread_setschedparam or pthread_create rather
  16.     than the actual running thread priority as returned by GetThreadPriority - as
  17.     required by POSIX. I.e. temporary or adjusted actual priority levels are not
  18.     returned by this routine.
  19.  
  20.     * pthread_create.c (pthread_create): For priority levels specified via
  21.     pthread attributes, attempt to map all priority levels between max and
  22.     min (as returned by sched_get_priority_min/max) to reasonable Win32
  23.     priority levels; record priority level given via attributes, or
  24.     inherited from parent thread, for later return by pthread_getschedparam.
  25.  
  26.     * ptw32_new.c (ptw32_new): Initialise pthread_t_ sched_priority element.
  27.  
  28.     * pthread_self.c (pthread_self): Set newly created implicit POSIX thread
  29.     sched_priority to Win32 thread's current actual priority. Temporarily
  30.     altered priorities can't be avoided in this case.
  31.  
  32.     * implement.h (struct pthread_t_): Add new sched_priority element.
  33.  
  34. 2003-09-12  Ross Johnson  <ross@callisto.canberra.edu.au>
  35.  
  36.     * sched_get_priority_min.c (sched_get_priority_min): On error should return -1
  37.     with errno set.
  38.     * sched_get_priority_max.c (sched_get_priority_max): Likewise.
  39.  
  40. 2003-09-03  Ross Johnson  <rpj@callisto.canberra.edu.au>
  41.  
  42.     * w32_cancelableWait.c (ptw32_cancelable_wait): Allow cancelation
  43.     of implicit POSIX threads as well.
  44.  
  45. 2003-09-02  Ross Johnson  <rpj@callisto.canberra.edu.au>
  46.  
  47.     * pthread_win32_attach_detach_np.c (pthread_win32_thread_detach_np):
  48.     Add comment.
  49.  
  50.     * pthread_exit.c (pthread_exit): Fix to recycle the POSIX thread handle in
  51.     addition to calling user TSD destructors. Move the implicit POSIX thread exit
  52.     handling to ptw32_throw to centralise the logic.
  53.  
  54.     * ptw32_throw.c (ptw32_throw): Implicit POSIX threads have no point
  55.     to jump or throw to, so cleanup and exit the thread here in this case. For
  56.     processes using the C runtime, the exit code will be set to the POSIX
  57.     reason for the throw (i.e. PTHREAD_CANCEL or the value given to pthread_exit).
  58.     Note that pthread_exit() already had similar logic, which has been moved to
  59.     here.
  60.  
  61.     * ptw32_threadDestroy.c (ptw32_threadDestroy): Don't close the Win32 handle
  62.     of implicit POSIX threads - expect this to be done by Win32?
  63.  
  64. 2003-09-01  Ross Johnson  <rpj@callisto.canberra.edu.au>
  65.  
  66.     * pthread_self.c (pthread_self): The newly aquired pthread_t must be
  67.     assigned to the reuse stack, not freed, if the routine fails somehow.
  68.  
  69. 2003-08-13  Ross Johnson  <rpj@ise.canberra.edu.au>
  70.  
  71.     * pthread_getschedparam.c (pthread_getschedparam): An invalid thread ID
  72.     parameter was returning an incorrect error value; now uses a more exhaustive
  73.     check for validity.
  74.  
  75.     * pthread_setschedparam.c (pthread_setschedparam): Likewise.
  76.  
  77.     * pthread_join.c (pthread_join): Now uses a more exhaustive
  78.     check for validity.
  79.  
  80.     * pthread_detach.c (pthread_detach): Likewise.
  81.  
  82.     * pthread_cancel.c (pthread_cancel): Likewise.
  83.  
  84.     * ptw32_threadDestroy.c (ptw32_threadDestroy): pthread_t structs are
  85.     never freed - push them onto a stack for reuse.
  86.  
  87.     * ptw32_new.c (ptw32_new): Check for reusable pthread_t before dynamically
  88.     allocating new memory for the struct.
  89.  
  90.     * pthread_kill.c (pthread_kill): New file; new routine; takes only a zero
  91.     signal arg so that applications can check the thread arg for validity; checks
  92.     that the underlying Win32 thread HANDLE is valid.
  93.  
  94.     * pthread.h (pthread_kill): Add prototype.
  95.  
  96.     * ptw32_reuse.c (ptw32_threadReusePop): New file; new routine; pop a
  97.     pthread_t off the reuse stack. pthread_t_ structs that have been destroyed, i.e.
  98.     have exited detached or have been joined, are cleaned up and put onto a reuse
  99.     stack. Consequently, thread IDs are no longer freed once calloced. The library
  100.     will attempt to get a struct off this stack before asking the system to alloc
  101.     new memory when creating threads. The stack is guarded by a global mutex.
  102.     (ptw32_threadReusePush): New routine; push a pthread_t onto the reuse stack.
  103.  
  104.     * implement.h (ptw32_threadReusePush): Add new prototype.
  105.     (ptw32_threadReusePop): Likewise.
  106.     (pthread_t): Add new element.
  107.  
  108.     * ptw32_processTerminate.c (ptw32_processTerminate): Delete the thread
  109.     reuse lock; free all thread ID structs on the thread reuse stack.
  110.  
  111.     * ptw32_processInitialize.c (ptw32_processInitialize): Initialise the
  112.     thread reuse lock.
  113.  
  114. 2003-07-19  Ross Johnson  <rpj@ise.canberra.edu.au>
  115.  
  116.     * GNUmakefile: modified to work under MsysDTK environment.
  117.     * pthread_spin_lock.c (pthread_spin_lock): Check for NULL arg.
  118.     * pthread_spin_unlock.c (pthread_spin_unlock): Likewise.
  119.     * pthread_spin_trylock.c (pthread_spin_trylock): Likewise;
  120.     fix incorrect pointer value if lock is dynamically initialised by
  121.     this function.
  122.     * sem_init.c (sem_init): Initialise sem_t value to quell compiler warning.
  123.     * sem_destroy.c (sem_destroy): Likewise.
  124.     * ptw32_threadStart.c (non-MSVC code sections): Include <exception> rather
  125.     than old-style <new.h>; fix all std:: namespace entities such as
  126.     std::terminate_handler instances and associated methods.
  127.     * ptw32_callUserDestroyRoutines.c (non-MSVC code sections): Likewise.
  128.  
  129. 2003-06-24  Piet van Bruggen  <pietvb@newbridges.nl>
  130.  
  131.     * pthread_spin_destroy.c (pthread_spin_destroy): Was not freeing the
  132.     spinlock struct.
  133.  
  134. 2003-06-22  Nicolas Barry  <boozai@yahoo.com>
  135.  
  136.     * pthread_mutex_destroy.c (pthread_mutex_destroy): When called
  137.     with a recursive mutex that was locked by the current thread, the
  138.     function was failing with a success return code.
  139.  
  140. 2003-05-15  Steven Reddie  <Steven.Reddie@ca.com>
  141.  
  142.     * pthread_win32_attach_detach_np.c (pthread_win32_process_detach_np):
  143.     NULLify ptw32_selfThreadKey after the thread is destroyed, otherwise
  144.     destructors calling pthreads routines might resurrect it again, creating
  145.     memory leaks. Call the underlying Win32 Tls routine directly rather than
  146.     pthread_setspecific().
  147.     (pthread_win32_thread_detach_np): Likewise.
  148.  
  149. 2003-05-14  Viv  <vcotirlea@hotmail.com>
  150.  
  151.     * pthread.dsp: Change /MT compile flag to /MD.
  152.  
  153. 2003-03-04  Alexander Terekhov  <TEREKHOV@de.ibm.com>
  154.  
  155.     * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Fix failure to
  156.     set ownership of mutex on second grab after abstime timeout.
  157.     - bug reported by Robert Strycek <strycek@posam.sk>
  158.  
  159. 2002-12-17  Thomas Pfaff  <tpfaff@gmx.net>
  160.  
  161.     * pthread_mutex_lock.c (ptw32_semwait): New static routine to provide
  162.     a non-cancelable sem_wait() function. This is consistent with the
  163.     way that pthread_mutex_timedlock.c does it.
  164.     (pthread_mutex_lock): Use ptw32_semwait() instead of sem_wait().
  165.  
  166. 2002-12-11  Thomas Pfaff  <tpfaff@gmx.net>
  167.  
  168.     * pthread_mutex_trylock.c: Should return EBUSY rather than EDEADLK.
  169.     * pthread_mutex_destroy.c: Remove redundant ownership test (the
  170.     trylock call does this for us); do not destroy a recursively locked
  171.     mutex.
  172.  
  173. 2002-09-20  Michael Johnson  <michaelj@maine.rr.com>
  174.  
  175.     * pthread_cond_destroy.c (pthread_cond_destroy): 
  176.     When two different threads exist, and one is attempting to
  177.     destroy a condition variable while the other is attempting to
  178.     initialize a condition variable that was created with
  179.     PTHREAD_COND_INITIALIZER, a deadlock can occur. Shrink
  180.     the ptw32_cond_list_lock critical section to fix it.
  181.  
  182. 2002-07-31  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  183.  
  184.     * ptw32_threadStart.c (ptw32_threadStart): Thread cancelLock
  185.     destruction moved to ptw32_threadDestroy().
  186.  
  187.     * ptw32_threadDestroy.c (ptw32_threadDestroy):  Destroy
  188.     the thread's cancelLock. Moved here from ptw32_threadStart.c
  189.     to cleanup implicit threads as well.
  190.  
  191. 2002-07-30  Alexander Terekhov  <TEREKHOV@de.ibm.com>
  192.  
  193.     * pthread_cond_wait.c (ptw32_cond_wait_cleanup): 
  194.     Remove code designed to avoid/prevent spurious wakeup
  195.     problems. It is believed that the sem_timedwait() call
  196.     is consuming a CV signal that it shouldn't and this is
  197.     breaking the avoidance logic.
  198.  
  199. 2002-07-30  Ross Johnson  <rpj@ise.canberra.edu.au>
  200.  
  201.     * sem_timedwait.c (sem_timedwait): Tighten checks for
  202.     unreasonable abstime values - that would result in
  203.     unexpected timeout values.
  204.  
  205.     * w32_CancelableWait.c (ptw32_cancelable_wait):
  206.     Tighten up return value checking and add comments.
  207.  
  208.  
  209. 2002-06-08  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  210.  
  211.     * sem_getvalue.c (sem_getvalue): Now returns a value for the
  212.     NEED_SEM version (i.e. earlier versions of WinCE).
  213.  
  214.  
  215. 2002-06-04  Rob Fanner  <rfanner@stonethree.com>
  216.  
  217.     * sem_getvalue.c (sem_getvalue): The Johnson M. Hart
  218.     approach didn't work - we are forced to take an
  219.     intrusive approach. We try to decrement the sema
  220.     and then immediately release it again to get the
  221.     value. There is a small probability that this may
  222.     block other threads, but only momentarily.
  223.  
  224. 2002-06-03  Ross Johnson  <rpj@ise.canberra.edu.au>
  225.  
  226.     * sem_init.c (sem_init): Initialise Win32 semaphores
  227.     to _POSIX_SEM_VALUE_MAX (which this implementation
  228.     defines in pthread.h) so that sem_getvalue() can use
  229.     the trick described in the comments in sem_getvalue().
  230.     * pthread.h (_POSIX_SEM_VALUE_MAX): Defined.
  231.     (_POSIX_SEM_NSEMS_MAX): Defined - not used but may be
  232.     useful for source code portability.
  233.  
  234. 2002-06-03  Rob Fanner  <rfanner@stonethree.com>
  235.  
  236.     * sem_getvalue.c (sem_getvalue): Did not work on NT.
  237.     Use approach suggested by Johnson M. Hart in his book
  238.     "Win32 System Programming".
  239.  
  240. 2002-02-28  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  241.  
  242.     * errno.c: Compiler directive was incorrectly including code.
  243.     * pthread.h: Conditionally added some #defines from config.h
  244.     needed when not building the library. e.g. NEED_ERRNO, NEED_SEM.
  245.     (PTW32_DLLPORT): Now only defined if _DLL defined.
  246.     (_errno): Compiler directive was incorrectly including prototype.
  247.     * sched.h: Conditionally added some #defines from config.h
  248.     needed when not building the library.
  249.     * semaphore.h: Replace an instance of NEED_SEM that should
  250.     have been NEED_ERRNO. This change currently has nil effect.
  251.  
  252.     * GNUmakefile: Correct some recent changes.
  253.  
  254.     * Makefile: Add rule to generate pre-processor output.
  255.  
  256. 2002-02-23  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  257.  
  258.     * pthread_rwlock_timedrdlock.c: New - untested.
  259.     * pthread_rwlock_timedwrlock.c: New - untested.
  260.     
  261.     * Testsuite passed (except known MSVC++ problems)
  262.  
  263.     * pthread_cond_destroy.c: Expand the time change
  264.     critical section to solve deadlock problem.
  265.  
  266.     * pthread.c: Add all remaining C modules.
  267.     * pthread.h: Use dllexport/dllimport attributes on functions
  268.     to avoid using pthread.def.
  269.     * sched.h: Likewise.
  270.     * semaphore.h: Likewise.
  271.     * GNUmakefile: Add new targets for single translation
  272.     unit build to maximise inlining potential; generate
  273.     pthread.def automatically.
  274.     * Makefile: Likewise, but no longer uses pthread.def.
  275.  
  276. 2002-02-20  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  277.  
  278.     * pthread_cond_destroy.c (pthread_cond_destroy):
  279.     Enter the time change critical section earlier.
  280.  
  281. 2002-02-17  Ross Johnson  <rpj@setup1.ise.canberra.edu.au
  282.  
  283.     * Testsuite passed.
  284.  
  285.     * pthread_timechange_handler_np.c: New; following
  286.     a suggestion from Alexander Terekhov that CVs should
  287.     be broadcast so that they all re-evaluate their
  288.     condition variables and reset a new timeout if
  289.     required, whenever an application receives a
  290.     WM_TIMECHANGE message. This message indicates that
  291.     the system time has been changed. Therefore, CVs
  292.     waiting for a timeout set as an abs_time will possibly
  293.     not wake up at the expected time. Some applications
  294.     may not be tolerant of this.
  295.     * pthread_cond_init.c: Add CV to linked list.
  296.     * pthread_cond_destroy.c: Remove CV from linked list.
  297.     * global.c (ptw32_cond_list_head): New variable.
  298.     (ptw32_cond_list_tail): New variable.
  299.     (ptw32_cond_list_cs): New critical section.
  300.     * ptw32_processInitialize (ptw32_cond_list_cs): Initialize.
  301.     * ptw32_processTerminate (ptw32_cond_list_cs): Delete.
  302.  
  303.  
  304.     * Reduce executable size.
  305.       -----------------------
  306.     When linking with the static library, only those
  307.     routines actually called, either directly or indirectly
  308.     should be included.
  309.  
  310.     [Gcc has the -ffunction-segments option to do this but MSVC
  311.     doesn't have this feature as far as I can determine. Other
  312.     compilers are undetermined as well. - rpj]
  313.  
  314.     * spin.c: Split file into function segments.
  315.     * ptw32_spinlock_check_need_init.c: Separated routine from spin.c.
  316.     * pthread_spin_init.c: Likewise.
  317.     * pthread_spin_destroy.c: Likewise.
  318.     * pthread_spin_lock.c: Likewise.
  319.     * pthread_spin_unlock.c: Likewise.
  320.     * pthread_spin_trylock.c: Likewise.
  321.  
  322.     * sync.c: Split file into function segments.
  323.     * pthread_detach.c: Separated routine from sync.c.
  324.     * pthread_join.c: Likewise.
  325.  
  326.     * tsd.c: Split file into function segments.
  327.     * pthread_key_create.c: Separated routine from tsd.c.
  328.     * pthread_key_delete.c: Likewise.
  329.     * pthread_setspecific.c: Likewise.
  330.     * pthread_getspecific.c: Likewise.
  331.  
  332.     * sched.c: Split file into function segments.
  333.     * pthread_attr_setschedpolicy.c: Separated routine from sched.c.
  334.     * pthread_attr_getschedpolicy.c: Likewise.
  335.     * pthread_attr_setschedparam.c: Likewise.
  336.     * pthread_attr_getschedparam.c: Likewise.
  337.     * pthread_attr_setinheritsched.c: Likewise.
  338.     * pthread_attr_getinheritsched.c: Likewise.
  339.     * pthread_setschedparam.c: Likewise.
  340.     * pthread_getschedparam.c: Likewise.
  341.     * sched_get_priority_max.c: Likewise.
  342.     * sched_get_priority_min.c: Likewise.
  343.     * sched_setscheduler.c: Likewise.
  344.     * sched_getscheduler.c: Likewise.
  345.     * sched_yield.c: Likewise.
  346.  
  347.  
  348. 2002-02-16  Ross Johnson  <rpj@setup1.ise.canberra.edu.au
  349.  
  350.     Reduce executable size.
  351.     -----------------------
  352.     When linking with the static library, only those
  353.     routines actually called, either directly or indirectly
  354.     should be included.
  355.  
  356.     [Gcc has the -ffunction-segments option to do this but MSVC
  357.     doesn't have this feature as far as I can determine. Other
  358.     compilers are undetermined as well. - rpj]
  359.  
  360.     * mutex.c: Split file into function segments.
  361.     * pthread_mutexattr_destroy.c: Separated routine from mutex.c
  362.     * pthread_mutexattr_getpshared.c: Likewise.
  363.     * pthread_mutexattr_gettype.c: Likewise.
  364.     * pthread_mutexattr_init.c: Likewise.
  365.     * pthread_mutexattr_setpshared.c: Likewise.
  366.     * pthread_mutexattr_settype.c: Likewise.
  367.     * ptw32_mutex_check_need_init.c: Likewise.
  368.     * pthread_mutex_destroy.c: Likewise.
  369.     * pthread_mutex_init.c: Likewise.
  370.     * pthread_mutex_lock.c: Likewise.
  371.     * pthread_mutex_timedlock.c: Likewise.
  372.     * pthread_mutex_trylock.c: Likewise.
  373.     * pthread_mutex_unlock.c: Likewise.
  374.     
  375.     * private.c: Split file into function segments.
  376.     * ptw32_InterlockedCompareExchange.c: Separated routine from private.c
  377.     * ptw32_callUserDestroyRoutines.c: Likewise.
  378.     * ptw32_getprocessors.c: Likewise.
  379.     * ptw32_processInitialize.c: Likewise.
  380.     * ptw32_processTerminate.c: Likewise.
  381.     * ptw32_threadDestroy.c: Likewise.
  382.     * ptw32_threadStart.c: Likewise.
  383.     * ptw32_throw.c: Likewise.
  384.     * ptw32_timespec.c: Likewise.
  385.     * ptw32_tkAssocCreate.c: Likewise.
  386.     * ptw32_tkAssocDestroy.c: Likewise.
  387.  
  388.     * rwlock.c: Split file into function segments.
  389.     * pthread_rwlockattr_destroy.c: Separated routine from rwlock.c
  390.     * pthread_rwlockattr_getpshared.c: Likewise.
  391.     * pthread_rwlockattr_init.c: Likewise.
  392.     * pthread_rwlockattr_setpshared.c: Likewise.
  393.     * ptw32_rwlock_check_need_init.c: Likewise.
  394.     * pthread_rwlock_destroy.c: Likewise.
  395.     * pthread_rwlock_init.c: Likewise.
  396.     * pthread_rwlock_rdlock.c: Likewise.
  397.     * pthread_rwlock_tryrdlock.c: Likewise.
  398.     * pthread_rwlock_trywrlock.c: Likewise.
  399.     * pthread_rwlock_unlock.c: Likewise.
  400.     * pthread_rwlock_wrlock.c: Likewise.
  401.  
  402. 2002-02-10  Ross Johnson  <rpj@setup1.ise.canberra.edu.au
  403.  
  404.     Reduce executable size.
  405.     -----------------------
  406.     When linking with the static library, only those
  407.     routines actually called, either directly or indirectly
  408.     should be included.
  409.  
  410.     [Gcc has the -ffunction-segments option to do this but MSVC
  411.     doesn't have this feature as far as I can determine. Other
  412.     compilers are undetermined as well. - rpj]
  413.  
  414.     * nonportable.c: Split file into function segments.
  415.     * np_delay.c: Separated routine from nonportable.c
  416.     * np_getw32threadhandle.c: Likewise.
  417.     * np_mutexattr_setkind.c: Likewise.
  418.     * np_mutexattr_getkind.c: Likewise.
  419.     * np_num_processors.c: Likewise.
  420.     * np_win32_attach_detach.c: Likewise.
  421.  
  422.     * misc.c: Split file into function segments.
  423.     * pthread_equal.c: Separated routine from nonportable.c.
  424.     * pthread_getconcurrency.c: Likewise.
  425.     * pthread_once.c: Likewise.
  426.     * pthread_self.c: Likewise.
  427.     * pthread_setconcurrency.c: Likewise.
  428.     * ptw32_calloc.c: Likewise.
  429.     * ptw32_new.c: Likewise.
  430.     * w32_CancelableWait.c: Likewise.
  431.     
  432. 2002-02-09  Ross Johnson  <rpj@setup1.ise.canberra.edu.au
  433.  
  434.     Reduce executable size.
  435.     -----------------------
  436.     When linking with the static library, only those
  437.     routines actually called, either directly or indirectly
  438.     should be included.
  439.  
  440.     [Gcc has the -ffunction-segments option to do this but MSVC
  441.     doesn't have this feature as far as I can determine. Other
  442.     compilers are undetermined as well. - rpj]
  443.  
  444.     * condvar.c: Split file into function segments.
  445.     * pthread_condattr_destroy.c: Separated routine from condvar.c.
  446.     * pthread_condattr_getpshared.c: Likewise.
  447.     * pthread_condattr_init.c: Likewise.
  448.     * pthread_condattr_setpshared.c: Likewise.
  449.     * ptw32_cond_check_need_init.c: Likewise.
  450.     * pthread_cond_destroy.c: Likewise.
  451.     * pthread_cond_init.c: Likewise.
  452.     * pthread_cond_signal.c: Likewise.
  453.     * pthread_cond_wait.c: Likewise.
  454.     
  455. 2002-02-07  Alexander Terekhov<TEREKHOV@de.ibm.com>
  456.  
  457.     * nonportable.c (pthread_delay_np): Make a true
  458.     cancelation point. Deferred cancels will interrupt the
  459.     wait.
  460.  
  461. 2002-02-07  Ross Johnson  <rpj@setup1.ise.canberra.edu.au
  462.  
  463.     * misc.c (ptw32_new): Add creation of cancelEvent so that
  464.     implicit POSIX threads (Win32 threads with a POSIX face)
  465.     are cancelable; mainly so that pthread_delay_np doesn't fail
  466.     if called from the main thread.
  467.     * create.c (pthread_create): Remove creation of cancelEvent
  468.     from here; now in ptw32_new().
  469.  
  470.     Reduce executable size.
  471.     -----------------------
  472.     When linking with the static library, only those
  473.     routines actually called, either directly or indirectly
  474.     should be included.
  475.  
  476.     [Gcc has the -ffunction-segments option to do this but MSVC
  477.     doesn't have this feature as far as I can determine. Other
  478.     compilers are undetermined as well. - rpj]
  479.  
  480.     * barrier.c: All routines are now in separate compilation units;
  481.     This file is used to congregate the separate modules for
  482.     potential inline optimisation and backward build compatibility.
  483.     * cancel.c: Likewise.
  484.     * pthread_barrierattr_destroy.c: Separated routine from cancel.c.
  485.     * pthread_barrierattr_getpshared.c: Likewise.
  486.     * pthread_barrierattr_init.c: Likewise.
  487.     * pthread_barrierattr_setpshared.c: Likewise.
  488.     * pthread_barrier_destroy.c: Likewise.
  489.     * pthread_barrier_init.c: Likewise.
  490.     * pthread_barrier_wait.c: Likewise.
  491.     * pthread_cancel.c: Likewise.
  492.     * pthread_setcancelstate.c: Likewise.
  493.     * pthread_setcanceltype.c: Likewise.
  494.     * pthread_testcancel.c: Likewise.
  495.  
  496. 2002-02-04  Max Woodbury <mtew@cds.duke.edu>
  497.  
  498.     Reduced name space pollution.
  499.     -----------------------------
  500.     When the appropriate symbols are defined, the headers
  501.     will restrict the definitions of new names. In particular,
  502.     it must be possible to NOT include the <windows.h>
  503.     header and related definitions with some combination
  504.     of symbol definitions. Secondly, it should be possible
  505.     that additional definitions should be limited to POSIX 
  506.     compliant symbols by the definition of appropriate symbols.
  507.  
  508.     * pthread.h: POSIX conditionals.
  509.     * sched.h: POSIX conditionals.
  510.     * semaphore.h: POSIX conditionals.
  511.  
  512.     * semaphore.c: Included <limits.h>.
  513.     (sem_init): Changed magic 0x7FFFFFFFL to INT_MAX.
  514.     (sem_getvalue): Trial version.
  515.  
  516.     Reduce executable size.
  517.     -----------------------
  518.     When linking with the static library, only those
  519.     routines actually called, either directly or indirectly
  520.     should be included.
  521.  
  522.     [Gcc has the -ffunction-segments option to do this but MSVC
  523.     doesn't have this feature as far as I can determine. Other
  524.     compilers are undetermined as well. - rpj]
  525.  
  526.     * semaphore.c: All routines are now in separate compilation units;
  527.     This file is used to congregate the separate modules for
  528.     potential inline optimisation and backward build compatibility.
  529.     * sem_close.c: Separated routine from semaphore.c.
  530.     * ptw32_decrease_semaphore.c: Likewise.
  531.     * sem_destroy.c: Likewise.
  532.     * sem_getvalue.c: Likewise.
  533.     * ptw32_increase_semaphore.c: Likewise.
  534.     * sem_init.c: Likewise.
  535.     * sem_open.c: Likewise.
  536.     * sem_post.c: Likewise.
  537.     * sem_post_multiple.c: Likewise.
  538.     * sem_timedwait.c: Likewise.
  539.     * sem_trywait.c: Likewise.
  540.     * sem_unlink.c: Likewise.
  541.     * sem_wait.c: Likewise.
  542.  
  543. 2002-02-04  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  544.  
  545.     The following extends the idea above to the rest of pthreads-win32 - rpj
  546.     
  547.     * attr.c: All routines are now in separate compilation units;
  548.     This file is used to congregate the separate modules for
  549.     potential inline optimisation and backward build compatibility.
  550.     * pthread_attr_destroy.c: Separated routine from attr.c.
  551.     * pthread_attr_getdetachstate.c: Likewise.
  552.     * pthread_attr_getscope.c: Likewise.
  553.     * pthread_attr_getstackaddr.c: Likewise.
  554.     * pthread_attr_getstacksize.c: Likewise.
  555.     * pthread_attr_init.c: Likewise.
  556.     * pthread_attr_is_attr.c: Likewise.
  557.     * pthread_attr_setdetachstate.c: Likewise.
  558.     * pthread_attr_setscope.c: Likewise.
  559.     * pthread_attr_setstackaddr.c: Likewise.
  560.     * pthread_attr_setstacksize.c: Likewise.
  561.  
  562.     * pthread.c: Agregation of agregate modules for super-inlineability.
  563.  
  564. 2002-02-02  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  565.  
  566.     * cancel.c: Rearranged some code and introduced checks
  567.     to disable cancelation at the start of a thread's cancelation
  568.     run to prevent double cancelation. The main problem
  569.     arises if a thread is canceling and then receives a subsequent
  570.     async cancel request.
  571.     * private.c: Likewise.
  572.     * condvar.c: Place pragmas around cleanup_push/pop to turn
  573.     off inline optimisation (/Obn where n>0 - MSVC only). Various
  574.     optimisation switches in MSVC turn this on, which interferes with
  575.     the way that cleanup handlers are run in C++ EH and SEH
  576.     code. Application code compiled with inline optimisation must
  577.     also wrap cleanup_push/pop blocks with the pragmas, e.g.
  578.       #pragma inline_depth(0)
  579.       pthread_cleanup_push(...)
  580.         ...
  581.       pthread_cleanup_pop(...)
  582.       #pragma inline_depth(8)
  583.     * rwlock.c: Likewise.
  584.     * mutex.c: Remove attempts to inline some functions.
  585.     * signal.c: Modify misleading comment.
  586.  
  587. 2002-02-01  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  588.  
  589.     * semaphore.c (sem_trywait): Fix missing errno return
  590.     for systems that define NEED_SEM (e.g. early WinCE).
  591.     * mutex.c (pthread_mutex_timedlock): Return ENOTSUP
  592.     for systems that define NEED_SEM since they don't
  593.     have sem_trywait().
  594.  
  595. 2002-01-27  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  596.  
  597.     * mutex.c (pthread_mutex_timedlock): New function suggested by
  598.     Alexander Terekhov. The logic required to implement this
  599.     properly came from Alexander, with some collaboration
  600.     with Thomas Pfaff.
  601.     (pthread_mutex_unlock): Wrap the waiters check and sema
  602.     post in a critical section to prevent a race with
  603.     pthread_mutex_timedlock.
  604.     (ptw32_timed_semwait): New function;
  605.     returns a special result if the absolute timeout parameter
  606.     represents a time already passed when called; used by
  607.     pthread_mutex_timedwait(). Have deliberately not reused
  608.     the name "ptw32_sem_timedwait" because they are not the same
  609.     routine.
  610.     * condvar.c (ptw32_cond_timedwait): Use the new sem_timedwait()
  611.     instead of ptw32_sem_timedwait(), which now has a different
  612.     function. See previous.
  613.     * implement.h: Remove prototype for ptw32_sem_timedwait.
  614.     See next.
  615.     (pthread_mutex_t_): Add critical section element for access
  616.     to lock_idx during mutex post-timeout processing.
  617.     * semaphore.h (sem_timedwait): See next.
  618.     * semaphore.c (sem_timedwait): See next.
  619.     * private.c (ptw32_sem_timedwait): Move to semaphore.c
  620.     and rename as sem_timedwait().
  621.  
  622. 2002-01-18  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  623.  
  624.     * sync.c (pthread_join): Was getting the exit code from the
  625.     calling thread rather than the joined thread if
  626.     defined(__MINGW32__) && !defined(__MSVCRT__).
  627.  
  628. 2002-01-15  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  629.  
  630.     * pthread.h: Unless the build explicitly defines __CLEANUP_SEH,
  631.     __CLEANUP_CXX, or __CLEANUP_C, then the build defaults to
  632.     __CLEANUP_C style cleanup. This style uses setjmp/longjmp
  633.     in the cancelation and thread exit implementations and therefore
  634.     won't do stack unwinding if linked to applications that have it
  635.     (e.g. C++ apps). This is currently consistent with most/all
  636.     commercial Unix POSIX threads implementations.
  637.  
  638.     * spin.c (pthread_spin_init): Edit renamed function call.
  639.     * nonportable.c (pthread_num_processors_np): New.
  640.     (pthread_getprocessors_np): Renamed to ptw32_getprocessors
  641.     and moved to private.c.
  642.     * private.c (pthread_getprocessors): Moved here from
  643.     nonportable.c.
  644.     * pthread.def (pthread_getprocessors_np): Removed
  645.     from export list.
  646.  
  647.     * rwlock.c (pthread_rwlockattr_init): New.
  648.     (pthread_rwlockattr_destroy): New.
  649.     (pthread_rwlockattr_getpshared): New.
  650.     (pthread_rwlockattr_setpshared): New.
  651.  
  652. 2002-01-14  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  653.  
  654.     * attr.c (pthread_attr_setscope): Fix struct pointer
  655.     indirection error introduced 2002-01-04.
  656.     (pthread_attr_getscope): Likewise.
  657.  
  658. 2002-01-12  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  659.  
  660.     * pthread.dsp (SOURCE): Add missing source files.
  661.  
  662. 2002-01-08  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  663.  
  664.     * mutex.c (pthread_mutex_trylock): use
  665.     ptw32_interlocked_compare_exchange function pointer
  666.     rather than ptw32_InterlockedCompareExchange() directly
  667.     to retain portability to non-iX86 processors,
  668.     e.g. WinCE etc. The pointer will point to the native
  669.     OS version of InterlockedCompareExchange() if the
  670.     OS supports it (see ChangeLog entry of 2001-10-17).
  671.  
  672. 2002-01-07  Thomas Pfaff <tpfaff@gmx.net>, Alexander Terekhov <TEREKHOV@de.ibm.com>
  673.  
  674.     * mutex.c (pthread_mutex_init): Remove critical
  675.     section calls.
  676.     (pthread_mutex_destroy): Likewise.
  677.     (pthread_mutex_unlock): Likewise.
  678.     (pthread_mutex_trylock): Likewise; uses
  679.     ptw32_InterlockedCompareExchange() to avoid need for
  680.     critical section; library is no longer i386 compatible;
  681.     recursive mutexes now increment the lock count rather
  682.     than return EBUSY; errorcheck mutexes return EDEADLCK
  683.     rather than EBUSY. This behaviour is consistent with the
  684.     Solaris pthreads implementation.
  685.     * implement.h (pthread_mutex_t_): Remove critical
  686.     section element - no longer needed.
  687.     
  688.  
  689. 2002-01-04  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  690.  
  691.     * attr.c (pthread_attr_setscope): Add more error
  692.     checking and actually store the scope value even
  693.     though it's not really necessary.
  694.     (pthread_attr_getscope): Return stored value.
  695.     * implement.h (pthread_attr_t_): Add new scope element.
  696.     * ANNOUNCE: Fix out of date comment next to
  697.     pthread_attr_setscope in conformance section.
  698.  
  699. 2001-12-21  Alexander Terekhov <TEREKHOV@de.ibm.com>
  700.  
  701.     * mutex.c (pthread_mutex_lock): Decrementing lock_idx was
  702.     not thread-safe.
  703.     (pthread_mutex_trylock): Likewise.
  704.  
  705. 2001-10-26  prionx@juno.com
  706.  
  707.     * semaphore.c (sem_init): Fix typo and missing bracket
  708.     in conditionally compiled code. Only older versions of
  709.     WinCE require this code, hence it doesn't normally get
  710.     tested; somehow when sem_t reverted to an opaque struct
  711.     the calloc NULL check was left in the conditionally included
  712.     section.
  713.     (sem_destroy): Likewise, the calloced sem_t wasn't being freed.
  714.  
  715. 2001-10-25  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  716.  
  717.     * GNUmakefile (libwsock32): Add to linker flags for
  718.     WSAGetLastError() and WSASetLastError().
  719.     * Makefile (wsock32.lib): Likewise.
  720.     * create.c: Minor mostly inert changes.
  721.     * implement.h (PTW32_MAX): Move into here and renamed
  722.     from sched.h.
  723.     (PTW32_MIN): Likewise.
  724.     * GNUmakefile (TEST_ICE): Define if testing internal
  725.     implementation of InterlockedCompareExchange.
  726.     * Makefile (TEST_ICE): Likewise.
  727.     * private.c (TEST_ICE): Likewise.
  728.     
  729. 2001-10-24  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  730.  
  731.     * attr.c (pthread_attr_setstacksize): Quell warning
  732.     from LCC by conditionally compiling the stacksize
  733.     validity check. LCC correctly warns that the condition
  734.     (stacksize < PTHREAD_STACK_MIN) is suspicious
  735.     because STACK_MIN is 0 and stacksize is of type
  736.     size_t (or unsigned int).
  737.  
  738. 2001-10-17  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  739.  
  740.     * barrier.c: Move _LONG and _LPLONG defines into
  741.     implement.h; rename to PTW32_INTERLOCKED_LONG and
  742.     PTW32_INTERLOCKED_LPLONG respectively.
  743.     * spin.c: Likewise; ptw32_interlocked_compare_exchange used
  744.     in place of InterlockedCompareExchange directly.
  745.     * global.c (ptw32_interlocked_compare_exchange): Add
  746.     prototype for this new routine pointer to be used when
  747.     InterlockedCompareExchange isn't supported by Windows.
  748.     * nonportable.c (pthread_win32_process_attach_np): Check for
  749.     support of InterlockedCompareExchange in kernel32 and assign its
  750.     address to ptw32_interlocked_compare_exchange if it exists, or
  751.     our own ix86 specific implementation ptw32_InterlockedCompareExchange.
  752.     *private.c (ptw32_InterlockedCompareExchange): An
  753.     implementation of InterlockedCompareExchange() which is
  754.     specific to ix86; written directly in assembler for either
  755.     MSVC or GNU C; needed because Windows 95 doesn't support
  756.     InterlockedCompareExchange().
  757.  
  758.     * sched.c (sched_get_priority_min): Extend to return
  759.     THREAD_PRIORITY_IDLE.
  760.     (sched_get_priority_max): Extend to return
  761.     THREAD_PRIORITY_CRITICAL.
  762.  
  763. 2001-10-15  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  764.  
  765.     * spin.c (pthread_spin_lock): PTHREAD_SPINLOCK_INITIALIZER
  766.     was causing a program fault.
  767.     (pthread_spin_init): Could have alloced memory
  768.     without freeing under some error conditions.
  769.  
  770.     * mutex.c (pthread_mutex_init): Move memory
  771.     allocation of mutex struct after checking for
  772.     PROCESS_SHARED.
  773.  
  774. 2001-10-12  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  775.  
  776.     * spin.c (pthread_spin_unlock): Was not returning
  777.     EPERM if the spinlock was not locked, for multi CPU
  778.     machines.
  779.  
  780. 2001-10-08  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  781.  
  782.     * spin.c (pthread_spin_trylock): Was not returning
  783.     EBUSY for multi CPU machines.
  784.  
  785. 2001-08-24  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  786.  
  787.     * condvar.c (pthread_cond_destroy): Remove cv element
  788.     that is no longer used.
  789.     * implement.h: Likewise.
  790.  
  791. 2001-08-23  Alexander Terekhov <TEREKHOV@de.ibm.com>
  792.  
  793.     * condvar.c (pthread_cond_destroy): fix bug with
  794.     respect to deadlock in the case of concurrent
  795.     _destroy/_unblock; a condition variable can be destroyed
  796.     immediately after all the threads that are blocked on
  797.     it are awakened.
  798.  
  799. 2001-08-23  Phil Frisbie, Jr. <phil@hawksoft.com>
  800.  
  801.     * tsd.c (pthread_getspecific): Preserve the last
  802.     winsock error [from WSAGetLastError()].
  803.  
  804. 2001-07-18  Scott McCaskill <scott@magruder.org>
  805.  
  806.     * mutex.c (pthread_mutexattr_init): Return ENOMEM
  807.     immediately and don't dereference the NULL pointer
  808.     if calloc fails.
  809.     (pthread_mutexattr_getpshared): Don't dereference
  810.     a pointer that is possibly NULL.
  811.     * barrier.c (pthread_barrierattr_init): Likewise
  812.     (pthread_barrierattr_getpshared): Don't dereference
  813.     a pointer that is possibly NULL.
  814.     * condvar.c (pthread_condattr_getpshared): Don't dereference
  815.     a pointer that is possibly NULL.
  816.  
  817. 2001-07-15  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  818.  
  819.     * rwlock.c (pthread_rwlock_wrlock): Is allowed to be
  820.     a cancelation point; re-enable deferred cancelability
  821.     around the CV call.
  822.  
  823. 2001-07-10  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  824.  
  825.     * barrier.c: Still more revamping. The exclusive access
  826.     mutex isn't really needed so it has been removed and replaced
  827.     by an InterlockedDecrement(). nSerial has been removed.
  828.     iStep is now dual-purpose. The process shared attribute
  829.     is now stored in the barrier struct.
  830.     * implement.h (pthread_barrier_t_): Lost some/gained one
  831.     elements.
  832.     * private.c (ptw32_threadStart): Removed some comments.
  833.  
  834. 2001-07-10  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  835.  
  836.     * barrier.c: Revamped to fix the race condition. Two alternating
  837.     semaphores are used instead of the PulseEvent. Also improved
  838.     overall throughput by returning PTHREAD_BARRIER_SERIAL_THREAD
  839.     to the first waking thread.
  840.     * implement.h (pthread_barrier_t_): Revamped.
  841.  
  842. 2001-07-09  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  843.  
  844.     * barrier.c: Fix several bugs in all routines. Now passes
  845.     tests/barrier5.c which is fairly rigorous. There is still
  846.     a non-optimal work-around for a race condition between
  847.     the barrier breeched event signal and event wait. Basically
  848.     the last (signalling) thread to hit the barrier yields
  849.     to allow any other threads, which may have lost the race,
  850.     to complete.
  851.  
  852. 2001-07-07  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  853.  
  854.     * barrier.c: Changed synchronisation mechanism to a
  855.     Win32 manual reset Event and use PulseEvent to signal
  856.     waiting threads. If the implementation continued to use
  857.     a semaphore it would require a second semaphore and
  858.     some management to use them alternately as barriers. A
  859.     single semaphore allows threads to cascade from one barrier
  860.     through the next, leaving some threads blocked at the first.
  861.     * implement.h (pthread_barrier_t_): As per above.
  862.     * general: Made a number of other routines inlinable.
  863.  
  864. 2001-07-07  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  865.  
  866.     * spin.c: Revamped and working; included static initialiser.
  867.     Now beta level.
  868.     * barrier.c: Likewise.
  869.     * condvar.c: Macro constant change; inline auto init routine.
  870.     * mutex.c: Likewise.
  871.     * rwlock.c: Likewise.
  872.     * private.c: Add support for spinlock initialiser.
  873.     * global.c: Likewise.
  874.     * implement.h: Likewise.
  875.     * pthread.h (PTHREAD_SPINLOCK_INITIALIZER): Fix typo.
  876.  
  877. 2001-07-05  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  878.  
  879.     * barrier.c: Remove static initialisation - irrelevent
  880.     for this object.
  881.     * pthread.h (PTHREAD_BARRIER_INITIALIZER): Removed.
  882.     * rwlock.c (pthread_rwlock_wrlock): This routine is
  883.     not a cancelation point - disable deferred
  884.     cancelation around call to pthread_cond_wait().
  885.  
  886. 2001-07-05  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  887.  
  888.     * spin.c: New module implementing spin locks.
  889.     * barrier.c: New module implementing barriers.
  890.     * pthread.h (_POSIX_SPIN_LOCKS): defined.
  891.     (_POSIX_BARRIERS): Defined.
  892.     (pthread_spin_*): Defined.
  893.     (pthread_barrier*): Defined.
  894.     (PTHREAD_BARRIER_SERIAL_THREAD): Defined.
  895.     * implement.h (pthread_spinlock_t_): Defined.
  896.     (pthread_barrier_t_): Defined.
  897.     (pthread_barrierattr_t_): Defined.
  898.  
  899.     * mutex.c (pthread_mutex_lock): Return with the error
  900.     if an auto-initialiser initialisation fails.
  901.  
  902.     * nonportable.c (pthread_getprocessors_np): New; gets the
  903.     number of available processors for the current process.
  904.  
  905. 2001-07-03  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  906.  
  907.     * pthread.h (_POSIX_READER_WRITER_LOCKS): Define it
  908.     if not already defined.
  909.  
  910. 2001-07-01  Alexander Terekhov <TEREKHOV@de.ibm.com>
  911.  
  912.     * condvar.c: Fixed lost signal bug reported by Timur Aydin
  913.     (taydin@snet.net).
  914.     [RPJ (me) didn't translate the original algorithm
  915.     correctly.]
  916.     * semaphore.c: Added sem_post_multiple; this is a useful
  917.     routine, but it doesn't appear to be standard. For now it's
  918.     not an exported function.
  919.     
  920. 2001-06-25  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  921.  
  922.     * create.c (pthread_create): Add priority inheritance
  923.     attributes.
  924.     * mutex.c (pthread_mutex_lock): Remove some overhead for
  925.     PTHREAD_MUTEX_NORMAL mutex types. Specifically, avoid
  926.     calling pthread_self() and pthread_equal() to check/set
  927.     the mutex owner. Introduce a new pseudo owner for this
  928.     type. Test results suggest increases in speed of up to
  929.     90% for non-blocking locks.
  930.     This is the default type of mutex used internally by other
  931.     synchronising objects, ie. condition variables and
  932.     read-write locks. The test rwlock7.c shows about a
  933.     30-35% speed increase over snapshot 2001-06-06. The
  934.     price of this is that the application developer
  935.     must ensure correct behaviour, or explicitly set the
  936.     mutex to a safer type such as PTHREAD_MUTEX_ERRORCHECK.
  937.     For example, PTHREAD_MUTEX_NORMAL (or PTHREAD_MUTEX_DEFAULT)
  938.     type mutexes will not return an error if a thread which is not
  939.     the owner calls pthread_mutex_unlock. The call will succeed
  940.     in unlocking the mutex if it is currently locked, but a
  941.     subsequent unlock by the true owner will then fail with EPERM.
  942.     This is however consistent with some other implementations.
  943.     (pthread_mutex_unlock): Likewise.
  944.     (pthread_mutex_trylock): Likewise.
  945.     (pthread_mutex_destroy): Likewise.
  946.     * attr.c (pthread_attr_init): PTHREAD_EXPLICIT_SCHED is the
  947.     default inheritance attribute; THREAD_PRIORITY_NORMAL is
  948.     the default priority for new threads.
  949.     * sched.c (pthread_attr_setschedpolicy): Added routine.
  950.     (pthread_attr_getschedpolicy): Added routine.
  951.     (pthread_attr_setinheritsched): Added routine.
  952.     (pthread_attr_getinheritsched): Added routine.
  953.     * pthread.h (sched_rr_set_interval): Added as a macro;
  954.     returns -1 with errno set to ENOSYS.
  955.  
  956. 2001-06-23  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  957.  
  958.     *sched.c (pthread_attr_setschedparam): Add priority range
  959.     check.
  960.     (sched_setscheduler): New function; checks for a valid
  961.     pid and policy; checks for permission to set information
  962.     in the target process; expects pid to be a Win32 process ID,
  963.     not a process handle; the only scheduler policy allowed is
  964.     SCHED_OTHER.
  965.     (sched_getscheduler): Likewise, but checks for permission
  966.     to query.
  967.     * pthread.h (SCHED_*): Moved to sched.h as defined in the
  968.     POSIX standard.
  969.     * sched.h (SCHED_*): Moved from pthread.h.
  970.     (pid_t): Defined if necessary.
  971.     (sched_setscheduler): Defined.
  972.     (sched_getscheduler): Defined.
  973.     * pthread.def (sched_setscheduler): Exported.
  974.     (sched_getscheduler): Likewise.
  975.  
  976. 2001-06-23  Ralf Brese <Ralf.Brese@pdb4.siemens.de>
  977.  
  978.     * create.c (pthread_create): Set thread priority from
  979.     thread attributes.
  980.  
  981. 2001-06-18  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  982.  
  983.     * Made organisational-only changes to UWIN additions.
  984.     * dll.c (dllMain): Moved UWIN process attach code
  985.     to pthread_win32_process_attach_np(); moved
  986.     instance of pthread_count to global.c.
  987.     * global.c (pthread_count): Moved from dll.c.
  988.     * nonportable.c (pthread_win32_process_attach_np):
  989.     Moved _UWIN code to here from dll.c.
  990.     * implement.h (pthread_count): Define extern int.
  991.     * create.c (pthread_count): Remove extern int.
  992.     * private.c (pthread_count): Likewise.
  993.     * exit.c (pthread_count): Likewise.
  994.  
  995. 2001-06-18  David Korn <dgk@research.att.com>
  996.  
  997.     * dll.c: Added changes necessary to work with UWIN.
  998.     * create.c: Likewise.
  999.     * pthread.h: Likewise.
  1000.     * misc.c: Likewise.
  1001.     * exit.c: Likewise.
  1002.     * private.c: Likewise.
  1003.     * implement.h: Likewise.
  1004.     There is some room at the start of struct pthread_t_
  1005.     to implement the signal semantics in UWIN's posix.dll
  1006.     although this is not yet complete.
  1007.     * Nmakefile: Compatible with UWIN's Nmake utility.
  1008.     * Nmakefile.tests: Likewise - for running the tests.
  1009.  
  1010. 2001-06-08  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1011.  
  1012.     * semaphore.h (sem_t): Fixed for compile and test.
  1013.     * implement.h (sem_t_): Likewise.
  1014.     * semaphore.c: Likewise.
  1015.     * private.c (ptw32_sem_timedwait): Updated to use new
  1016.     opaque sem_t.
  1017.  
  1018. 2001-06-06  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1019.  
  1020.     * semaphore.h (sem_t): Is now an opaque pointer;
  1021.     moved actual definition to implement.h.
  1022.     * implement.h (sem_t_): Move here from semaphore.h;
  1023.     was the definition of sem_t.
  1024.     * semaphore.c: Wherever necessary, changed use of sem
  1025.     from that of a pointer to a pointer-pointer; added
  1026.     extra checks for a valid sem_t; NULL sem_t when
  1027.     it is destroyed; added extra checks when creating
  1028.     and destroying sem_t elements in the NEED_SEM
  1029.     code branches; changed from using a pthread_mutex_t
  1030.     ((*sem)->mutex) to CRITICAL_SECTION ((*sem)->sem_lock_cs)
  1031.     in NEED_SEM branches for access serialisation.
  1032.  
  1033. 2001-06-06  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1034.  
  1035.     * mutex.c (pthread_mutexattr_init): Remove 
  1036.     ptw32_mutex_default_kind.
  1037.     
  1038. 2001-06-05  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1039.  
  1040.     * nonportable.c (pthread_mutex_setdefaultkind_np):
  1041.     Remove - should not have been included in the first place.
  1042.     (pthread_mutex_getdefaultkind_np): Likewise.
  1043.     * global.c (ptw32_mutex_default_kind): Likewise.
  1044.     * mutex.c (pthread_mutex_init): Remove use of
  1045.     ptw32_mutex_default_kind.
  1046.     * pthread.h (pthread_mutex_setdefaultkind_np): Likewise.
  1047.     (pthread_mutex_getdefaultkind_np): Likewise.
  1048.     * pthread.def (pthread_mutexattr_setkind_np): Added.
  1049.     (pthread_mutexattr_getkind_np): Likewise.
  1050.  
  1051.     * README: Many changes that should have gone in before
  1052.     the last snapshot.
  1053.     * README.NONPORTABLE: New - referred to by ANNOUNCE
  1054.     but never created; documents the non-portable routines
  1055.     included in the library - moved from README with new
  1056.     routines added.
  1057.     * ANNOUNCE (pthread_mutexattr_setkind_np): Added to
  1058.     compliance list.
  1059.     (pthread_mutexattr_getkind_np): Likewise.
  1060.  
  1061. 2001-06-04  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1062.  
  1063.     * condvar.c: Add original description of the algorithm as
  1064.     developed by Terekhov and Thomas, plus reference to
  1065.     README.CV.
  1066.  
  1067. 2001-06-03  Alexander Terekhov <TEREKHOV@de.ibm.com>, Louis Thomas <lthomas@arbitrade.com>
  1068.  
  1069.     * condvar.c (pthread_cond_init): Completely revamped.
  1070.     (pthread_cond_destroy): Likewise.
  1071.     (ptw32_cond_wait_cleanup): Likewise.
  1072.     (ptw32_cond_timedwait): Likewise.
  1073.     (ptw32_cond_unblock): New general signaling routine.
  1074.     (pthread_cond_signal): Now calls ptw32_cond_unblock.
  1075.     (pthread_cond_broadcast): Likewise.
  1076.     * implement.h (pthread_cond_t_): Revamped.
  1077.     * README.CV: New; explanation of the above changes.
  1078.  
  1079. 2001-05-30  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1080.  
  1081.     * pthread.h (rand_r): Fake using _seed argument to quell
  1082.     compiler warning (compiler should optimise this away later).
  1083.  
  1084.     * GNUmakefile (OPT): Leave symbolic information out of the library
  1085.     and increase optimisation level - for smaller faster prebuilt
  1086.     dlls.
  1087.     
  1088. 2001-05-29  Milan Gardian <Milan.Gardian@LEIBINGER.com>
  1089.  
  1090.     * Makefile: fix typo.
  1091.     * pthreads.h: Fix problems with stdcall/cdecl conventions, in particular
  1092.     remove the need for PT_STDCALL everywhere; remove warning supression.
  1093.     * (errno): Fix the longstanding "inconsistent dll linkage" problem
  1094.     with errno; now also works with /MD debugging libs - 
  1095.     warnings emerged when compiling pthreads library with /MD (or /MDd)
  1096.     compiler switch, instead of /MT (or /MTd) (i.e. when compiling pthreads
  1097.     using Multithreaded DLL CRT instead of Multithreaded statically linked
  1098.     CRT).
  1099.     * create.c (pthread_create): Likewise; fix typo.
  1100.     * private.c (ptw32_threadStart): Eliminate use of terminate() which doesn't
  1101.     throw exceptions.
  1102.     * Remove unnecessary #includes from a number of modules -
  1103.     [I had to #include malloc.h in implement.h for gcc - rpj].
  1104.  
  1105. 2001-05-29  Thomas Pfaff <tpfaff@gmx.net>
  1106.  
  1107.     * pthread.h (PTHREAD_MUTEX_DEFAULT): New; equivalent to
  1108.     PTHREAD_MUTEX_DEFAULT_NP.
  1109.     * (PTHREAD_MUTEX_NORMAL): Similarly.
  1110.     * (PTHREAD_MUTEX_ERRORCHECK): Similarly.
  1111.     * (PTHREAD_MUTEX_RECURSIVE): Similarly.
  1112.     * (pthread_mutex_setdefaultkind_np): New; Linux compatibility stub
  1113.     for pthread_mutexattr_settype.
  1114.     * (pthread_mutexattr_getkind_np): New; Linux compatibility stub
  1115.     for pthread_mutexattr_gettype.
  1116.     * mutex.c (pthread_mutexattr_settype): New; allow
  1117.     the following types of mutex:
  1118.       PTHREAD_MUTEX_DEFAULT_NP
  1119.       PTHREAD_MUTEX_NORMAL_NP
  1120.       PTHREAD_MUTEX_ERRORCHECK_NP
  1121.       PTHREAD_MUTEX_RECURSIVE_NP
  1122.     * Note that PTHREAD_MUTEX_DEFAULT is equivalent to
  1123.     PTHREAD_MUTEX_NORMAL - ie. mutexes should no longer
  1124.     be recursive by default, and a thread will deadlock if it
  1125.     tries to relock a mutex it already owns. This is inline with
  1126.     other pthreads implementations.
  1127.     * (pthread_mutex_lock): Process the lock request
  1128.     according to the mutex type.
  1129.     * (pthread_mutex_init): Eliminate use of Win32 mutexes as the
  1130.     basis of POSIX mutexes - instead, a combination of one critical section
  1131.     and one semaphore are used in conjunction with Win32 Interlocked* routines.
  1132.     * (pthread_mutex_destroy): Likewise.
  1133.     * (pthread_mutex_lock): Likewise.
  1134.     * (pthread_mutex_trylock): Likewise.
  1135.     * (pthread_mutex_unlock): Likewise.
  1136.     * Use longjmp/setjmp to implement cancelation when building the library
  1137.     using a C compiler which doesn't support exceptions, e.g. gcc -x c (note
  1138.     that gcc -x c++ uses exceptions).
  1139.     * Also fixed some of the same typos and eliminated PT_STDCALL as
  1140.     Milan Gardian's patches above.
  1141.  
  1142. 2001-02-07  Alexander Terekhov <TEREKHOV@de.ibm.com>
  1143.  
  1144.     * rwlock.c: Revamped.
  1145.     * implement.h (pthread_rwlock_t_): Redefined.
  1146.     This implementation does not have reader/writer starvation problem.
  1147.     Rwlock attempts to behave more like a normal mutex with
  1148.     races and scheduling policy determining who is more important;
  1149.     It also supports recursive locking,
  1150.     has less synchronization overhead (no broadcasts at all,
  1151.     readers are not blocked on any condition variable) and seem to
  1152.     be faster than the current implementation [W98 appears to be
  1153.     approximately 15 percent faster at least - on top of speed increase
  1154.     from Thomas Pfaff's changes to mutex.c - rpj].
  1155.  
  1156. 2000-12-29  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1157.  
  1158.     * Makefile: Back-out "for" loops which don't work.
  1159.  
  1160.     * GNUmakefile: Remove the fake.a target; add the "realclean"
  1161.     target; don't remove built libs under the "clean" target.
  1162.  
  1163.     * config.h: Add a guard against multiple inclusion.
  1164.  
  1165.     * semaphore.h: Add some defines from config.h to make
  1166.     semaphore.h independent of config.h when building apps.
  1167.  
  1168.     * pthread.h (_errno): Back-out previous fix until we know how to
  1169.     fix it properly.
  1170.  
  1171.     * implement.h (lockCount): Add missing element to pthread_mutex_t_.
  1172.  
  1173.     * sync.c (pthread_join): Spelling fix in comment.
  1174.  
  1175.     * private.c (ptw32_threadStart): Reset original termination
  1176.     function (C++).
  1177.     (ptw32_threadStart): Cleanup detached threads early in case
  1178.     the library is statically linked.
  1179.     (ptw32_callUserDestroyRoutines): Remove [SEH] __try block from
  1180.     destructor call so that unhandled exceptions will be passed through
  1181.     to the     system; call terminate() from [C++] try block for the same
  1182.     reason.
  1183.  
  1184.     * tsd.c (pthread_getspecific): Add comment.
  1185.  
  1186.     * mutex.c (pthread_mutex_init): Initialise new elements in
  1187.     pthread_mutex_t.
  1188.     (pthread_mutex_unlock): Invert "pthread_equal()" test.
  1189.  
  1190. 2000-12-28  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1191.  
  1192.     * semaphore.c (mode_t): Use ifndef HAVE_MODE_T to include definition.
  1193.  
  1194.     * config.h.in (HAVE_MODE_T): Added.
  1195.     (_UWIN): Start adding defines for the UWIN package.
  1196.  
  1197.     * private.c (ptw32_threadStart): Unhandled exceptions are
  1198.     now passed through to the system to deal with. This is consistent
  1199.     with normal Windows behaviour. C++ applications may use
  1200.     set_terminate() to override the default behaviour which is
  1201.     to call ptw32_terminate(). Ptw32_terminate() cleans up some
  1202.     POSIX thread stuff before calling the system default function
  1203.     which calls abort(). The users termination function should conform
  1204.     to standard C++ semantics which is to not return. It should
  1205.     exit the thread (call pthread_exit()) or exit the application.
  1206.     * private.c (ptw32_terminate): Added as the default set_terminate()
  1207.     function. It calls the system default function after cleaning up
  1208.     some POSIX thread stuff.
  1209.  
  1210.     * implement.h (ptw32_try_enter_critical_section): Move
  1211.     declaration.
  1212.     * global.c (ptw32_try_enter_critical_section): Moved
  1213.     from dll.c.
  1214.     * dll.c: Move process and thread attach/detach code into
  1215.     functions in nonportable.c.
  1216.     * nonportable.c (pthread_win32_process_attach_np): Process
  1217.     attach code from dll.c is now available to static linked
  1218.     applications.
  1219.     * nonportable.c (pthread_win32_process_detach_np): Likewise.
  1220.     * nonportable.c (pthread_win32_thread_attach_np): Likewise.
  1221.     * nonportable.c (pthread_win32_thread_detach_np): Likewise.
  1222.  
  1223.     * pthread.h: Add new non-portable prototypes for static
  1224.     linked applications.
  1225.  
  1226.     * GNUmakefile (OPT): Increase optimisation flag and remove
  1227.     debug info flag.
  1228.  
  1229.     * pthread.def: Add new non-portable exports for static
  1230.     linked applications.
  1231.  
  1232. 2000-12-11  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1233.  
  1234.     * FAQ: Update Answer 6 re getting a fully working
  1235.     Mingw32 built library.
  1236.  
  1237. 2000-10-10  Steven Reddie <smr@essemer.com.au>
  1238.  
  1239.         * misc.c (pthread_self): Restore Win32 "last error"
  1240.         cleared by TlsGetValue() call in
  1241.         pthread_getspecific()
  1242.  
  1243. 2000-09-20  Arthur Kantor <akantor@bexusa.com>
  1244.  
  1245.         * mutex.c (pthread_mutex_lock): Record the owner
  1246.         of the mutex. This requires also keeping count of
  1247.         recursive locks ourselves rather than leaving it
  1248.         to Win32 since we need to know when to NULL the
  1249.         thread owner when the mutex is unlocked.
  1250.         (pthread_mutex_trylock): Likewise.
  1251.         (pthread_mutex_unlock): Check that the calling
  1252.         thread owns the mutex, decrement the recursive
  1253.         lock count, and NULL the owner if zero. Return
  1254.         EPERM if the mutex is owned by another thread.
  1255.         * implement.h (pthread_mutex_t_): Add ownerThread
  1256.         and lockCount members.
  1257.  
  1258. 2000-09-13  Jef Gearhart <jgearhart@tpssys.com>
  1259.  
  1260.     * mutex.c (pthread_mutex_init): Call
  1261.     TryEnterCriticalSection through the pointer
  1262.     rather than directly so that the dll can load
  1263.     on Windows versions that can't resolve the
  1264.     function, eg. Windows 95
  1265.  
  1266. 2000-09-09  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1267.  
  1268.     * pthread.h (ctime_r): Fix arg.
  1269.  
  1270. 2000-09-08  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1271.  
  1272.     * GNUmakefile(_WIN32_WINNT=0x400): Define in CFLAGS;
  1273.     doesn't seem to be needed though.
  1274.  
  1275.     * cancel.c (pthread_cancel): Must get "self" through
  1276.     calling pthread_self() which will ensure a POSIX thread
  1277.     struct is built for non-POSIX threads; return an error
  1278.     if this fails
  1279.     - Ollie Leahy <ollie@mpt.ie>
  1280.     (pthread_setcancelstate): Likewise.
  1281.     (pthread_setcanceltype): Likewise.
  1282.     * misc.c (ptw32_cancelable_wait): Likewise.
  1283.  
  1284.     * private.c (ptw32_tkAssocCreate): Remove unused #if 0
  1285.     wrapped code.
  1286.  
  1287.     * pthread.h (ptw32_get_exception_services_code):
  1288.     Needed to be forward declared unconditionally.
  1289.  
  1290. 2000-09-06  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1291.  
  1292.     * cancel.c (pthread_cancel): If called from the main
  1293.     thread "self" would be NULL; get "self" via pthread_self()
  1294.     instead of directly from TLS so that an implicit
  1295.     pthread object is created.
  1296.  
  1297.     * misc.c (pthread_equal): Strengthen test for NULLs.
  1298.  
  1299. 2000-09-02  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1300.  
  1301.     * condvar.c (ptw32_cond_wait_cleanup): Ensure that all
  1302.     waking threads check if they are the last, and notify
  1303.     the broadcaster if so - even if an error occurs in the
  1304.     waiter.
  1305.  
  1306.     * semaphore.c (_decrease_semaphore): Should be
  1307.     a call to ptw32_decrease_semaphore.
  1308.     (_increase_semaphore): Should be a call to
  1309.     ptw32_increase_semaphore.
  1310.  
  1311.     * misc.c (ptw32_cancelable_wait): Renamed from
  1312.     CancelableWait.
  1313.     * rwlock.c (_rwlock_check*): Renamed to
  1314.     ptw32_rwlock_check*.
  1315.     * mutex.c (_mutex_check*): Renamed to ptw32_mutex_check*.
  1316.     * condvar.c (cond_timed*): Renamed to ptw32_cond_timed*.
  1317.     (_cond_check*): Renamed to ptw32_cond_check*.
  1318.     (cond_wait_cleanup*): Rename to ptw32_cond_wait_cleanup*.
  1319.     (ptw32_cond_timedwait): Add comments.
  1320.  
  1321. 2000-08-22  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1322.  
  1323.     * private.c (ptw32_throw): Fix exception test;
  1324.     move exceptionInformation declaration.
  1325.  
  1326.     * tsd.c (pthread_key_create): newkey wrongly declared.
  1327.  
  1328.     * pthread.h: Fix comment block.
  1329.  
  1330. 2000-08-18  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1331.  
  1332.     * mutex.c (pthread_mutex_destroy): Check that the mutex isn't
  1333.     held; invalidate the mutex as early as possible to avoid
  1334.     contention; not perfect - FIXME!
  1335.  
  1336.     * rwlock.c (pthread_rwlock_init): Remove redundant assignment
  1337.     to "rw".
  1338.     (pthread_rwlock_destroy): Invalidate the rwlock before
  1339.     freeing up any of it's resources - to avoid contention.
  1340.  
  1341.     * private.c (ptw32_tkAssocCreate): Change assoc->lock
  1342.     to use a dynamically initialised mutex - only consumes
  1343.     a W32 mutex or critical section when first used,
  1344.     not before.
  1345.  
  1346.     * mutex.c (pthread_mutex_init): Remove redundant assignment
  1347.     to "mx".
  1348.     (pthread_mutexattr_destroy): Set attribute to NULL
  1349.     before freeing it's memory - to avoid contention.
  1350.  
  1351.     * implement.h (PTW32_EPS_CANCEL/PTW32_EPS_EXIT):
  1352.     Must be defined for all compilers - used as generic
  1353.     exception selectors by ptw32_throw().
  1354.  
  1355.     * Several: Fix typos from scripted edit session
  1356.     yesterday.
  1357.  
  1358.     * nonportable.c (pthread_mutexattr_setforcecs_np):
  1359.     Moved this function from mutex.c.
  1360.     (pthread_getw32threadhandle_np): New function to
  1361.     return the win32 thread handle that the POSIX
  1362.     thread is using.
  1363.     * mutex.c (pthread_mutexattr_setforcecs_np):
  1364.     Moved to new file "nonportable.c".
  1365.  
  1366.     * pthread.h (PTW32_BUILD): Only    redefine __except
  1367.     and catch compiler keywords if we aren't building
  1368.     the library (ie. PTW32_BUILD is not defined) - 
  1369.     this is safer than defining and then undefining
  1370.     if not building the library.
  1371.     * implement.h: Remove __except and catch undefines.
  1372.     * Makefile (CFLAGS): Define PTW32_BUILD.
  1373.     * GNUmakefile (CFLAGS): Define PTW32_BUILD.
  1374.  
  1375.     * All appropriate: Change Pthread_exception* to
  1376.     ptw32_exception* to be consistent with internal
  1377.     identifier naming.
  1378.  
  1379.     * private.c (ptw32_throw): New function to provide
  1380.     a generic exception throw for all internal
  1381.     exceptions and EH schemes.
  1382.     (ptw32_threadStart): pthread_exit() value is now
  1383.     returned via the thread structure exitStatus
  1384.     element.
  1385.     * exit.c (pthread_exit): pthread_exit() value is now
  1386.     returned via the thread structure exitStatus
  1387.     element.
  1388.     * cancel.c (ptw32_cancel_self): Now uses ptw32_throw.
  1389.     (pthread_setcancelstate): Ditto.
  1390.     (pthread_setcanceltype): Ditto.
  1391.     (pthread_testcancel): Ditto.
  1392.     (pthread_cancel): Ditto.
  1393.     * misc.c (CancelableWait): Ditto.
  1394.     * exit.c (pthread_exit): Ditto.
  1395.     * All applicable: Change PTW32_ prefix to
  1396.     PTW32_ prefix to remove leading underscores
  1397.     from private library identifiers.
  1398.  
  1399. 2000-08-17  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1400.  
  1401.     * All applicable: Change _pthread_ prefix to
  1402.     ptw32_ prefix to remove leading underscores
  1403.     from private library identifiers (single
  1404.     and double leading underscores are reserved in the
  1405.     ANSI C standard for compiler implementations).
  1406.  
  1407.     * tsd.c (pthread_create_key): Initialise temporary
  1408.     key before returning it's address to avoid race
  1409.     conditions.
  1410.  
  1411. 2000-08-13  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1412.  
  1413.     * errno.c: Add _MD precompile condition; thus far
  1414.     had no effect when using /MD compile option but I
  1415.     thnk it should be there.
  1416.  
  1417.     * exit.c: Add __cplusplus to various #if lines;
  1418.     was compiling SEH code even when VC++ had
  1419.     C++ compile options.
  1420.  
  1421.     * private.c: ditto.
  1422.  
  1423.     * create.c (pthread_create): Add PT_STDCALL macro to
  1424.     function pointer arg in _beginthread().
  1425.  
  1426.     * pthread.h: PT_STDCALL really does need to be defined
  1427.     in both this and impliment.h; don't set it to __cdecl
  1428.     - this macro is only used to extend function pointer
  1429.     casting for functions that will be passed as parameters.
  1430.     (~PThreadCleanup): add cast and group expression.
  1431.     (_errno): Add _MD compile conditional.
  1432.     (PtW32NoCatchWarn): Change pragma message.
  1433.  
  1434.     * implement.h: Move and change PT_STDCALL define.
  1435.  
  1436.     * need_errno.h: Add _MD to compilation conditional.
  1437.  
  1438.     * GNUmakefile: Substantial rewrite for new naming
  1439.     convention; set for nil optimisation (turn it up
  1440.     when we have a working library build; add target
  1441.     "fake.a" to build a libpthreadw32.a from the VC++
  1442.     built DLL pthreadVCE.dll.
  1443.  
  1444.     * pthread.def (LIBRARY): Don't specify in the .def
  1445.     file - it is specified on the linker command line
  1446.     since we now use the same .def file for variously
  1447.     named .dlls.
  1448.  
  1449.     * Makefile: Substantial rewrite for new naming
  1450.     convention; default nmake target only issues a
  1451.     help message; run nmake with specific target
  1452.     corresponding to the EH scheme being used.
  1453.  
  1454.     * README: Update information; add naming convention
  1455.     explanation.
  1456.  
  1457.     * ANNOUNCE: Update information.
  1458.  
  1459. 2000-08-12  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1460.  
  1461.     * pthread.h: Add compile-time message when using
  1462.     MSC_VER compiler and C++ EH to warn application
  1463.     programmers to use PtW32Catch instead of catch(...)
  1464.     if they want cancelation and pthread_exit to work.
  1465.  
  1466.     * implement.h: Remove #include <semaphore.h>; we
  1467.     use our own local semaphore.h.
  1468.  
  1469. 2000-08-10  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1470.  
  1471.     * cleanup.c (pthread_pop_cleanup): Remove _pthread
  1472.     prefix from __except and catch keywords; implement.h
  1473.     now simply undefines ptw32__except and
  1474.     ptw32_catch if defined; VC++ was not textually
  1475.     substituting ptw32_catch etc back to catch as
  1476.     it was redefined; the reason for using the prefixed
  1477.     version was to make it clear that it was not using
  1478.     the pthread.h redefined catch keyword.
  1479.  
  1480.     * private.c (ptw32_threadStart): Ditto.
  1481.     (ptw32_callUserDestroyRoutines): Ditto.
  1482.  
  1483.     * implement.h (ptw32__except): Remove #define.
  1484.     (ptw32_catch): Remove #define.
  1485.  
  1486.     * GNUmakefile (pthread.a): New target to build
  1487.     libpthread32.a from pthread.dll using dlltool.
  1488.  
  1489.     * buildlib.bat: Duplicate cl commands with args to
  1490.     build C++ EH version of pthread.dll; use of .bat
  1491.     files is redundant now that nmake compatible
  1492.     Makefile is included; used as a kludge only now.
  1493.  
  1494.     * Makefile: Localise some macros and fix up the clean:
  1495.     target to extend it and work properly.
  1496.  
  1497.     * CONTRIBUTORS: Add contributors.
  1498.  
  1499.     * ANNOUNCE: Updated.
  1500.  
  1501.     * README: Updated.
  1502.  
  1503. 2000-08-06  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1504.  
  1505.     * pthread.h: Remove #warning - VC++ doesn't accept it.
  1506.  
  1507. 2000-08-05  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1508.  
  1509.     * pthread.h (PtW32CatchAll): Add macro. When compiling
  1510.     applications using VC++ with C++ EH rather than SEH
  1511.     'PtW32CatchAll' must be used in place of any 'catch( ... )'
  1512.     if the application wants pthread cancelation or
  1513.     pthread_exit() to work.
  1514.  
  1515. 2000-08-03  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1516.  
  1517.     * pthread.h: Add a base class ptw32_exception for
  1518.     library internal exceptions and change the "catch"
  1519.     re-define macro to use it.
  1520.  
  1521. 2000-08-02  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1522.  
  1523.     * GNUmakefile (CFLAGS): Add -mthreads.
  1524.     Add new targets to generate cpp and asm output.
  1525.  
  1526.     * sync.c (pthread_join): Remove dead code.
  1527.  
  1528. 2000-07-25  Tristan Savatier <tristan@mpegtv.com>
  1529.  
  1530.     * sched.c (sched_get_priority_max): Handle different WinCE and
  1531.     Win32 priority values together.
  1532.     (sched_get_priority_min): Ditto.
  1533.  
  1534. 2000-07-25  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1535.  
  1536.     * create.c (pthread_create): Force new threads to wait until
  1537.     pthread_create has the new thread's handle; we also retain
  1538.     a local copy of the handle for internal use until
  1539.     pthread_create returns.
  1540.  
  1541.     * private.c (ptw32_threadStart): Initialise ei[].
  1542.     (ptw32_threadStart): When beginthread is used to start the
  1543.     thread, force waiting until the creator thread had the 
  1544.     thread handle.
  1545.  
  1546.     * cancel.c (ptw32_cancel_thread): Include context switch
  1547.     code for defined(_X86_) environments in addition to _M_IX86.
  1548.  
  1549.     * rwlock.c (pthread_rwlock_destroy): Assignment changed
  1550.     to avoid compiler warning.
  1551.  
  1552.     * private.c (ptw32_get_exception_services_code): Cast
  1553.     NULL return value to avoid compiler warning.
  1554.  
  1555.     * cleanup.c (pthread_pop_cleanup): Initialise "cleanup" variable
  1556.     to avoid compiler warnings.
  1557.  
  1558.     * misc.c (ptw32_new): Change "new" variable to "t" to avoid
  1559.     confusion with the C++ keyword of the same name.
  1560.  
  1561.     * condvar.c (cond_wait_cleanup): Initialise lastWaiter variable.
  1562.     (cond_timedwait): Remove unused local variables. to avoid
  1563.     compiler warnings.
  1564.  
  1565.     * dll.c (dllMain): Remove 2000-07-21 change - problem
  1566.     appears to be in pthread_create().
  1567.  
  1568. 2000-07-22  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1569.  
  1570.     * tsd.c (pthread_key_create): If a destructor was given
  1571.     and the pthread_mutex_init failed, then would try to
  1572.     reference a NULL pointer (*key); eliminate this section of
  1573.     code by using a dynamically initialised mutex
  1574.     (PTHREAD_MUTEX_INITIALIZER).
  1575.  
  1576.     * tsd.c (pthread_setspecific): Return an error if
  1577.     unable to set the value; simplify cryptic conditional.
  1578.  
  1579.     * tsd.c (pthread_key_delete): Locking threadsLock relied
  1580.     on mutex_lock returning an error if the key has no destructor.
  1581.     ThreadsLock is only initialised if the key has a destructor.
  1582.     Making this mutex a static could reduce the number of mutexes
  1583.     used by an application since it is actually created only at
  1584.     first use and it's often destroyed soon after.
  1585.     
  1586. 2000-07-22  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1587.  
  1588.     * FAQ: Added Q5 and Q6.
  1589.  
  1590. 2000-07-21  David Baggett <dmb@itasoftware.com>
  1591.  
  1592.     * dll.c: Include resource leakage work-around. This is a
  1593.     partial FIXME which doesn't stop all leakage. The real
  1594.     problem needs to be found and fixed.
  1595.  
  1596. 2000-07-21  Ross Johnson  <rpj@setup1.ise.canberra.edu.au>
  1597.  
  1598.     * create.c (pthread_create): Set threadH to 0 (zero)
  1599.     everywhere. Some assignments were using NULL. Maybe
  1600.     it should be NULL everywhere - need to check. (I know
  1601.     they are nearly always the same thing - but not by
  1602.     definition.)
  1603.  
  1604.     * misc.c (pthread_self): Try to catch NULL thread handles
  1605.     at the point where they might be generated, even though
  1606.     they should always be valid at this point.
  1607.  
  1608.     * tsd.c (pthread_setspecific): return an error value if
  1609.     pthread_self() returns NULL.
  1610.  
  1611.     * sync.c (pthread_join): return an error value if
  1612.     pthread_self() returns NULL.
  1613.  
  1614.     * signal.c (pthread_sigmask): return an error value if
  1615.     pthread_self() returns NULL.
  1616.  
  1617. 2000-03-02  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1618.  
  1619.     * attr.c (pthread_attr_init): Set default stacksize to zero (0)
  1620.     rather than PTHREAD_STACK_MIN even though these are now the same.
  1621.  
  1622.     * pthread.h (PTHREAD_STACK_MIN): Lowered to 0.
  1623.  
  1624. 2000-01-28  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1625.  
  1626.     * mutex.c (pthread_mutex_init): Free mutex if it has been alloced;
  1627.     if critical sections can be used instead of Win32 mutexes, test
  1628.     that the critical section works and return an error if not.
  1629.  
  1630. 2000-01-07  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1631.  
  1632.     * cleanup.c (pthread_pop_cleanup): Include SEH code only if MSC is not
  1633.     compiling as C++.
  1634.     (pthread_push_cleanup): Include SEH code only if MSC is not
  1635.     compiling as C++.
  1636.  
  1637.     * pthread.h: Include SEH code only if MSC is not
  1638.     compiling as C++.
  1639.  
  1640.     * implement.h: Include SEH code only if MSC is not
  1641.     compiling as C++.
  1642.  
  1643.     * cancel.c (ptw32_cancel_thread): Add _M_IX86 check.
  1644.     (pthread_testcancel): Include SEH code only if MSC is not
  1645.     compiling as C++.
  1646.     (ptw32_cancel_self): Include SEH code only if MSC is not
  1647.     compiling as C++.
  1648.  
  1649. 2000-01-06  Erik Hensema <erik.hensema@group2000.nl>
  1650.  
  1651.     * Makefile: Remove inconsistencies in 'cl' args
  1652.  
  1653. 2000-01-04  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1654.  
  1655.     * private.c (ptw32_get_exception_services_code): New; returns
  1656.     value of EXCEPTION_PTW32_SERVICES.
  1657.     (ptw32_processInitialize): Remove initialisation of
  1658.     ptw32_exception_services which is no longer needed.
  1659.  
  1660.     * pthread.h (ptw32_exception_services): Remove extern.
  1661.     (ptw32_get_exception_services_code): Add function prototype;
  1662.     use this to return EXCEPTION_PTW32_SERVICES value instead of
  1663.     using the ptw32_exception_services variable which I had
  1664.     trouble exporting through pthread.def.
  1665.  
  1666.     * global.c (ptw32_exception_services): Remove declaration.
  1667.  
  1668. 1999-11-22  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1669.  
  1670.     * implement.h: Forward declare ptw32_new();
  1671.  
  1672.     * misc.c (ptw32_new): New; alloc and initialise a new pthread_t.
  1673.     (pthread_self): New thread struct is generated     by new routine
  1674.     ptw32_new().
  1675.  
  1676.     * create.c (pthread_create): New thread struct is generated
  1677.     by new routine ptw32_new().
  1678.  
  1679. 1999-11-21  Ross Johnson  <rpj@special.ise.canberra.edu.au>
  1680.  
  1681.     * global.c (ptw32_exception_services): Declare new variable. 
  1682.  
  1683.     * private.c (ptw32_threadStart): Destroy thread's
  1684.     cancelLock mutex; make 'catch' and '__except' usageimmune to
  1685.     redfinitions in pthread.h.
  1686.     (ptw32_processInitialize): Init new constant ptw32_exception_services.
  1687.  
  1688.     * create.c (pthread_create): Initialise thread's cancelLock
  1689.     mutex.
  1690.  
  1691.     * cleanup.c (pthread_pop_cleanup): Make 'catch' and '__except'
  1692.     usage immune to redfinition s in pthread.h.
  1693.  
  1694.     * private.c: Ditto.
  1695.  
  1696.     * pthread.h (catch): Redefine 'catch' so that C++ applications
  1697.     won't catch our internal exceptions.
  1698.     (__except): ditto for __except.
  1699.  
  1700.     * implement.h (ptw32_catch): Define internal version
  1701.     of 'catch' because 'catch' is redefined by pthread.h.
  1702.     (__except): ditto for __except.
  1703.     (struct pthread_t_): Add cancelLock mutex for async cancel
  1704.     safety.
  1705.  
  1706. 1999-11-21  Jason Nye <jnye@nbnet.nb.ca>, Erik Hensema <erik.hensema@group2000.nl>
  1707.  
  1708.     * cancel.c (ptw32_cancel_self): New; part of the async
  1709.     cancellation implementation.
  1710.     (ptw32_cancel_thread): Ditto; this function is X86
  1711.     processor specific.
  1712.     (pthread_setcancelstate): Add check for pending async
  1713.     cancel request and cancel the calling thread if
  1714.     required; add async-cancel safety lock.
  1715.     (pthread_setcanceltype): Ditto.
  1716.  
  1717. 1999-11-13  Erik Hensema <erik.hensema@group2000.nl>
  1718.  
  1719.     * configure.in (AC_OUTPUT): Put generated output into GNUmakefile
  1720.     rather than Makefile. Makefile will become the MSC nmake compatible
  1721.     version
  1722.  
  1723. 1999-11-13  John Bossom (John.Bossom@cognos.com>
  1724.  
  1725.     * misc.c (pthread_self): Add a note about GetCurrentThread
  1726.     returning a pseudo-handle
  1727.  
  1728. 1999-11-10  Todd Owen <towen@lucidcalm.dropbear.id.au>
  1729.  
  1730.     * dll.c (dllMain): Free kernel32 ASAP.
  1731.     If TryEnterCriticalSection is not being used, then free
  1732.     the kernel32.dll handle now, rather than leaving it until
  1733.     DLL_PROCESS_DETACH.
  1734.  
  1735.     Note: this is not a pedantic exercise in freeing unused
  1736.     resources!  It is a work-around for a bug in Windows 95
  1737.     (see microsoft knowledge base article, Q187684) which
  1738.     does Bad Things when FreeLibrary is called within
  1739.     the DLL_PROCESS_DETACH code, in certain situations.
  1740.     Since w95 just happens to be a platform which does not
  1741.     provide TryEnterCriticalSection, the bug will be
  1742.     effortlessly avoided.
  1743.  
  1744. 1999-11-10  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1745.  
  1746.     * sync.c (pthread_join): Make it a deferred cancelation point.
  1747.  
  1748.     * misc.c (pthread_self): Explicitly initialise implicitly
  1749.     created thread state to default values.
  1750.  
  1751. 1999-11-05  Tristan Savatier <tristan@mpegtv.com>
  1752.  
  1753.     * pthread.h (winsock.h): Include unconditionally.
  1754.     (ETIMEDOUT): Change fallback value to that defined by winsock.h.
  1755.     
  1756.     * general: Patched for portability to WinCE. The details are
  1757.     described in the file WinCE-PORT. Follow the instructions
  1758.     in README.WinCE to make the appropriate changes in config.h.
  1759.  
  1760. 1999-10-30  Erik Hensema <erik.hensema@group2000.nl>
  1761.  
  1762.     * create.c (pthread_create): Explicitly initialise thread state to
  1763.     default values.
  1764.  
  1765.     * cancel.c (pthread_setcancelstate): Check for NULL 'oldstate'
  1766.     for compatibility with Solaris pthreads;
  1767.     (pthread_setcanceltype): ditto:
  1768.  
  1769. 1999-10-23  Erik Hensema <erik.hensema@group2000.nl>
  1770.  
  1771.     * pthread.h (ctime_r): Fix incorrect argument "_tm"
  1772.  
  1773. 1999-10-21  Aurelio Medina <aureliom@crt.com>
  1774.  
  1775.     * pthread.h (_POSIX_THREADS): Only define it if it isn't
  1776.     already defined. Projects may need to define this on
  1777.     the CC command line under Win32 as it doesn't have unistd.h
  1778.  
  1779. 1999-10-17  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1780.  
  1781.     * rwlock.c (pthread_rwlock_destroy): Add cast to remove compile
  1782.     warning.
  1783.  
  1784.     * condvar.c (pthread_cond_broadcast): Only release semaphores
  1785.     if there are waiting threads.
  1786.  
  1787. 1999-10-15  Lorin Hochstein <lmh@xiphos.ca>, Peter Slacik <Peter.Slacik@tatramed.sk>
  1788.  
  1789.     * condvar.c (cond_wait_cleanup): New static cleanup handler for
  1790.     cond_timedwait;
  1791.     (cond_timedwait): pthread_cleanup_push args changed;
  1792.     canceling a thread while it's in pthread_cond_wait
  1793.     will now decrement the waiters count and cleanup if it's the
  1794.     last waiter.
  1795.  
  1796. 1999-10-15  Graham Dumpleton <Graham.Dumpleton@ra.pad.otc.telstra.com.au>
  1797.  
  1798.     * condvar.c (cond_wait_cleanup): the last waiter will now reset the CV's
  1799.     wasBroadcast flag
  1800.  
  1801. Thu Sep 16 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  1802.  
  1803.     * rwlock.c (pthread_rwlock_destroy): Add serialisation.
  1804.     (_rwlock_check_need_init): Check for detroyed rwlock.
  1805.     * rwlock.c: Check return codes from _rwlock_check_need_init();
  1806.     modify comments; serialise access to rwlock objects during
  1807.     operations; rename rw_mutex to rw_lock.
  1808.     * implement.h: Rename rw_mutex to rw_lock.
  1809.     * mutex.c (pthread_mutex_destroy): Add serialisation.
  1810.     (_mutex_check_need_init): Check for detroyed mutex.
  1811.     * condvar.c (pthread_cond_destroy): Add serialisation.
  1812.     (_cond_check_need_init): Check for detroyed condvar.
  1813.     * mutex.c: Modify comments.
  1814.     * condvar.c: Modify comments.
  1815.  
  1816. 1999-08-10  Aurelio Medina  <aureliom@crt.com>
  1817.  
  1818.     * implement.h (pthread_rwlock_t_): Add.
  1819.     * pthread.h (pthread_rwlock_t): Add.
  1820.     (PTHREAD_RWLOCK_INITIALIZER): Add.
  1821.     Add rwlock function prototypes.
  1822.     * rwlock.c: New module.
  1823.     * pthread.def: Add new rwlock functions.
  1824.     * private.c (ptw32_processInitialize): initialise
  1825.     ptw32_rwlock_test_init_lock critical section.
  1826.     * global.c (ptw32_rwlock_test_init_lock): Add.
  1827.  
  1828.     * mutex.c (pthread_mutex_destroy): Don't free mutex memory
  1829.     if mutex is PTHREAD_MUTEX_INITIALIZER and has not been
  1830.     initialised yet.
  1831.  
  1832. 1999-08-08 Milan Gardian <mg@tatramed.sk>
  1833.  
  1834.     * mutex.c (pthread_mutex_destroy): Free mutex memory.
  1835.  
  1836. 1999-08-22  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1837.  
  1838.     * exit.c (pthread_exit): Fix reference to potentially
  1839.     uninitialised pointer.
  1840.  
  1841. 1999-08-21  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1842.  
  1843.     * private.c (ptw32_threadStart): Apply fix of 1999-08-19
  1844.     this time to C++ and non-trapped C versions. Ommitted to
  1845.     do this the first time through.
  1846.  
  1847. 1999-08-19  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1848.  
  1849.     * private.c (ptw32_threadStart): Return exit status from
  1850.     the application thread startup routine.
  1851.     - Milan Gardian <mg@tatramed.sk>
  1852.  
  1853. 1999-08-18  John Bossom <john.Bossom@cognos.com>
  1854.  
  1855.     * exit.c (pthread_exit): Put status into pthread_t->exitStatus
  1856.     * private.c (ptw32_threadStart): Set pthread->exitStatus
  1857.     on exit of try{} block.
  1858.     * sync.c (pthread_join): use pthread_exitStatus value if the
  1859.     thread exit doesn't return a value (for Mingw32 CRTDLL
  1860.     which uses endthread instead of _endthreadex).
  1861.  
  1862. Tue Aug 17 20:17:58 CDT 1999  Mumit Khan  <khan@xraylith.wisc.edu>
  1863.  
  1864.         * create.c (pthread_create): Add CRTDLL suppport.
  1865.         * exit.c (pthread_exit): Likewise.
  1866.         * private.c (ptw32_threadStart): Likewise.
  1867.         (ptw32_threadDestroy): Likewise.
  1868.         * sync.c (pthread_join): Likewise.
  1869.         * tests/join1.c (main): Warn about partial support for CRTDLL.
  1870.  
  1871. Tue Aug 17 20:00:08 1999  Mumit Khan  <khan@xraylith.wisc.edu>
  1872.  
  1873.         * Makefile.in (LD): Delete entry point.
  1874.         * acconfig.h (STDCALL): Delete unused macro.
  1875.         * configure.in: Remove test for STDCALL.
  1876.         * config.h.in: Regenerate.
  1877.         * errno.c (_errno): Fix self type.
  1878.         * pthread.h (PT_STDCALL): Move from here to
  1879.         * implement.h (PT_STDCALL): here.
  1880.         (ptw32_threadStart): Fix prototype.
  1881.         * private.c (ptw32_threadStart): Likewise.
  1882.  
  1883. 1999-08-14  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1884.  
  1885.     * exit.c (pthread_exit): Don't call pthread_self() but
  1886.     get thread handle directly from TSD for efficiency.
  1887.     
  1888. 1999-08-12  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1889.  
  1890.     * private.c (ptw32_threadStart): ei[] only declared if _MSC_VER.
  1891.  
  1892.     * exit.c (pthread_exit): Check for implicitly created threads
  1893.     to avoid raising an unhandled exception.
  1894.     
  1895. 1999-07-12  Peter Slacik <Peter.Slacik@tatramed.sk>
  1896.  
  1897.     * condvar.c (pthread_cond_destroy): Add critical section.
  1898.     (cond_timedwait): Add critical section; check for timeout
  1899.     waiting on semaphore.
  1900.     (pthread_cond_broadcast): Add critical section.
  1901.  
  1902. 1999-07-09  Lorin Hochstein <lmh@xiphos.ca>, John Bossom <John.Bossom@Cognos.COM>
  1903.  
  1904.     The problem was that cleanup handlers were not executed when
  1905.     pthread_exit() was called.
  1906.  
  1907.     * implement.h (pthread_t_): Add exceptionInformation element for
  1908.     C++ per-thread exception information.
  1909.     (general): Define and rename exceptions.
  1910.  
  1911. 1999-07-09  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1912.  
  1913.     * misc.c (CancelableWait):  PTW32_EPS_CANCEL (SEH) and
  1914.     ptw32_exception_cancel (C++) used to identify the exception.
  1915.  
  1916.     * cancel.c (pthread_testcancel): PTW32_EPS_CANCEL (SEH) and
  1917.     ptw32_exception_cancel (C++) used to identify the exception.
  1918.  
  1919.     * exit.c (pthread_exit): throw/raise an exception to return to
  1920.     ptw32_threadStart() to exit the thread. PTW32_EPS_EXIT (SEH)
  1921.     and ptw32_exception_exit (C++) used to identify the exception.
  1922.  
  1923.     * private.c (ptw32_threadStart): Add pthread_exit exception trap;
  1924.     clean up and exit the thread directly rather than via pthread_exit().
  1925.  
  1926. Sun May 30 00:25:02 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1927.  
  1928.     * semaphore.h (mode_t): Conditionally typedef it.
  1929.  
  1930. Fri May 28 13:33:05 1999  Mark E. Armstrong <avail@pacbell.net>
  1931.  
  1932.     * condvar.c (pthread_cond_broadcast): Fix possible memory fault
  1933.     
  1934. Thu May 27 13:08:46 1999  Peter Slacik <Peter.Slacik@tatramed.sk>
  1935.  
  1936.     * condvar.c (pthread_cond_broadcast): Fix logic bug
  1937.  
  1938. Thu May 27 13:08:46 1999  Bossom, John <John.Bossom@Cognos.COM>
  1939.  
  1940.     * condvar.c (pthread_cond_broadcast): optimise sem_post loop
  1941.  
  1942. Fri May 14 12:13:18 1999  Mike Russo <miker@eai.com>
  1943.  
  1944.     * attr.c (pthread_attr_setdetachstate): Fix logic bug
  1945.  
  1946. Sat May  8 09:42:30 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1947.  
  1948.     * pthread.def (sem_open): Add.
  1949.     (sem_close): Add.
  1950.     (sem_unlink): Add.
  1951.     (sem_getvalue): Add.
  1952.  
  1953.     * FAQ (Question 3): Add.
  1954.  
  1955. Thu Apr  8 01:16:23 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1956.  
  1957.     * semaphore.c (sem_open): New function; returns an error (ENOSYS).
  1958.     (sem_close): ditto.
  1959.     (sem_unlink): ditto.
  1960.     (sem_getvalue): ditto.
  1961.  
  1962.     * semaphore.h (_POSIX_SEMAPHORES): define.
  1963.     
  1964. Wed Apr  7 14:09:52 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  1965.  
  1966.     * errno.c (_REENTRANT || _MT): Invert condition.
  1967.  
  1968.     * pthread.h (_errno): Conditionally include prototype.
  1969.  
  1970. Wed Apr  7 09:37:00 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1971.  
  1972.     * *.c (comments): Remove individual attributions - these are
  1973.     documented sufficiently elsewhere.
  1974.  
  1975.     * implement.h (pthread.h): Remove extraneous include.
  1976.  
  1977. Sun Apr  4 11:05:57 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1978.  
  1979.     * sched.c (sched.h): Include.
  1980.  
  1981.     * sched.h: New file for POSIX 1b scheduling.
  1982.  
  1983.     * pthread.h: Move opaque structures to implement.h; move sched_*
  1984.     prototypes out and into sched.h.
  1985.  
  1986.     * implement.h: Add opaque structures from pthread.h.
  1987.  
  1988.     * sched.c (sched_yield): New function.
  1989.  
  1990.     * condvar.c (ptw32_sem_*): Rename to sem_*; except for
  1991.     ptw32_sem_timedwait which is an private function.
  1992.  
  1993. Sat Apr  3 23:28:00 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1994.  
  1995.     * Makefile.in (OBJS): Add errno.o.
  1996.  
  1997. Fri Apr  2 11:08:50 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  1998.  
  1999.     * implement.h (ptw32_sem_*): Remove prototypes now defined in
  2000.     semaphore.h.
  2001.  
  2002.     * pthread.h (sempahore.h): Include.
  2003.  
  2004.     * semaphore.h: New file for POSIX 1b semaphores.
  2005.  
  2006.     * semaphore.c (ptw32_sem_timedwait): Moved to private.c.
  2007.  
  2008.     * pthread.h (ptw32_sem_t): Change to sem_t. 
  2009.  
  2010.     * private.c (ptw32_sem_timedwait): Moved from semaphore.c;
  2011.     set errno on error.
  2012.  
  2013.     * pthread.h (pthread_t_): Add per-thread errno element.
  2014.  
  2015. Fri Apr  2 11:08:50 1999  John Bossom <jebossom@cognos.com>
  2016.  
  2017.     * semaphore.c (ptw32_sem_*): Change to sem_*; these functions
  2018.     will be exported from the library; set errno on error.
  2019.  
  2020.     * errno.c (_errno): New file. New function.
  2021.  
  2022. Fri Mar 26 14:11:45 1999  Tor Lillqvist <tml@iki.fi>
  2023.  
  2024.     * semaphore.c (ptw32_sem_timedwait): Check for negative
  2025.     milliseconds.
  2026.  
  2027. Wed Mar 24 11:32:07 1999  John Bossom <jebossom@cognos.com>
  2028.  
  2029.     * misc.c (CancelableWait): Initialise exceptionInformation[2].
  2030.     (pthread_self): Get a real Win32 thread handle for implicit threads.
  2031.  
  2032.     * cancel.c (pthread_testcancel): Initialise exceptionInformation[2].
  2033.  
  2034.     * implement.h (SE_INFORMATION): Fix values.
  2035.  
  2036.     * private.c (ptw32_threadDestroy): Close the thread handle.
  2037.  
  2038. Fri Mar 19 12:57:27 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2039.  
  2040.     * cancel.c (comments): Update and cleanup.
  2041.  
  2042. Fri Mar 19 09:12:59 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2043.  
  2044.     * private.c (ptw32_threadStart): status returns PTHREAD_CANCELED.
  2045.  
  2046.     * pthread.h (PTHREAD_CANCELED): defined.
  2047.  
  2048. Tue Mar 16  1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2049.  
  2050.     * all: Add GNU LGPL and Copyright and Warranty.
  2051.     
  2052. Mon Mar 15 00:20:13 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2053.  
  2054.     * condvar.c (pthread_cond_init): fix possible uninitialised use
  2055.     of cv.
  2056.  
  2057. Sun Mar 14 21:01:59 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2058.  
  2059.     * condvar.c (pthread_cond_destroy): don't do full cleanup if
  2060.     static initialised cv has never been used.
  2061.     (cond_timedwait): check result of auto-initialisation.
  2062.  
  2063. Thu Mar 11 09:01:48 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2064.  
  2065.     * pthread.h (pthread_mutex_t): revert to (pthread_mutex_t *);
  2066.     define a value to serve as PTHREAD_MUTEX_INITIALIZER.
  2067.     (pthread_mutex_t_): remove staticinit and valid elements.
  2068.     (pthread_cond_t): revert to (pthread_cond_t_ *);
  2069.     define a value to serve as PTHREAD_COND_INITIALIZER.
  2070.     (pthread_cond_t_): remove staticinit and valid elements.
  2071.  
  2072.     * mutex.c (pthread_mutex_t args): adjust indirection of references.
  2073.     (all functions): check for PTHREAD_MUTEX_INITIALIZER value;
  2074.     check for NULL (invalid).
  2075.  
  2076.     * condvar.c (pthread_cond_t args): adjust indirection of references.
  2077.     (all functions): check for PTHREAD_COND_INITIALIZER value;
  2078.     check for NULL (invalid).
  2079.  
  2080. Wed Mar 10 17:18:12 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2081.  
  2082.     * misc.c (CancelableWait): Undo changes from Mar 8 and 7.
  2083.  
  2084. Mon Mar  8 11:18:59 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2085.  
  2086.     * misc.c (CancelableWait): Ensure cancelEvent handle is the lowest
  2087.     indexed element in the handles array. Enhance test for abandoned
  2088.     objects.
  2089.  
  2090.     * pthread.h (PTHREAD_MUTEX_INITIALIZER): Trailing elements not
  2091.     initialised are set to zero by the compiler. This avoids the
  2092.     problem of initialising the opaque critical section element in it.
  2093.     (PTHREAD_COND_INITIALIZER): Ditto.
  2094.  
  2095.     * semaphore.c (ptw32_sem_timedwait): Check sem == NULL earlier.
  2096.  
  2097. Sun Mar  7 12:31:14 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2098.  
  2099.     * condvar.c (pthread_cond_init): set semaphore initial value
  2100.     to 0, not 1. cond_timedwait was returning signaled immediately.
  2101.  
  2102.     * misc.c (CancelableWait): Place the cancel event handle first
  2103.     in the handle table for WaitForMultipleObjects. This ensures that
  2104.     the cancel event is recognised and acted apon if both objects
  2105.     happen to be signaled together.
  2106.  
  2107.     * private.c (ptw32_cond_test_init_lock): Initialise and destroy.
  2108.  
  2109.     * implement.h (ptw32_cond_test_init_lock): Add extern.
  2110.  
  2111.     * global.c (ptw32_cond_test_init_lock): Add declaration. 
  2112.  
  2113.     * condvar.c (pthread_cond_destroy): check for valid initialised CV;
  2114.     flag destroyed CVs as invalid.
  2115.     (pthread_cond_init): pthread_cond_t is no longer just a pointer.
  2116.     This is because PTHREAD_COND_INITIALIZER needs state info to reside
  2117.     in pthread_cond_t so that it can initialise on first use. Will work on
  2118.     making pthread_cond_t (and other objects like it) opaque again, if
  2119.     possible, later.
  2120.     (cond_timedwait): add check for statically initialisation of
  2121.     CV; initialise on first use.
  2122.     (pthread_cond_signal): check for valid CV.
  2123.     (pthread_cond_broadcast): check for valid CV.
  2124.     (_cond_check_need_init): Add.
  2125.  
  2126.     * pthread.h (PTHREAD_COND_INITIALIZER): Fix.
  2127.     (pthread_cond_t): no longer a pointer to pthread_cond_t_.
  2128.     (pthread_cond_t_): add 'staticinit' and 'valid' elements.
  2129.  
  2130. Sat Mar 6 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2131.  
  2132.     * implement.h: Undate comments.
  2133.  
  2134. Sun Feb 21 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2135.  
  2136.     * pthread.h (PTHREAD_MUTEX_INITIALIZER): missing braces around
  2137.     cs element initialiser.
  2138.  
  2139. 1999-02-21  Ben Elliston  <bje@cygnus.com>
  2140.  
  2141.     * pthread.h (pthread_exit): The return type of this function is
  2142.     void, not int.
  2143.  
  2144.     * exit.c (pthread_exit): Do not return 0.
  2145.  
  2146. Sat Feb 20 16:03:30 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2147.  
  2148.     * dll.c (DLLMain): Expand TryEnterCriticalSection support test.
  2149.  
  2150.     * mutex.c (pthread_mutex_trylock): The check for
  2151.     ptw32_try_enter_critical_section == NULL should have been
  2152.     removed long ago.
  2153.  
  2154. Fri Feb 19 16:03:30 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2155.  
  2156.     * sync.c (pthread_join): Fix pthread_equal() test.
  2157.  
  2158.     * mutex.c (pthread_mutex_trylock): Check mutex != NULL before
  2159.     using it.
  2160.  
  2161. Thu Feb 18 16:17:30 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2162.  
  2163.     * misc.c (pthread_equal): Fix inverted result.
  2164.  
  2165.     * Makefile.in: Use libpthread32.a as the name of the DLL export
  2166.     library instead of pthread.lib.
  2167.  
  2168.     * condvar.c (pthread_cond_init): cv could have been used unitialised;
  2169.     initialise.
  2170.  
  2171.     * create.c (pthread_create): parms could have been used unitialised;
  2172.     initialise.
  2173.  
  2174.     * pthread.h (struct pthread_once_t_): Remove redefinition.
  2175.  
  2176. Sat Feb 13 03:03:30 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2177.  
  2178.     * pthread.h (struct pthread_once_t_): Replaced.
  2179.  
  2180.     * misc.c (pthread_once): Replace with John Bossom's version;
  2181.     has lighter weight serialisation; fixes problem of not holding
  2182.     competing threads until after the init_routine completes.
  2183.  
  2184. Thu Feb 11 13:34:14 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2185.  
  2186.     * misc.c (CancelableWait): Change C++ exception throw.
  2187.  
  2188.     * sync.c (pthread_join): Change FIXME comment - issue resolved.
  2189.  
  2190. Wed Feb 10 12:49:11 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2191.  
  2192.     * configure: Various temporary changes.
  2193.     - Kevin Ruland <Kevin.Ruland@anheuser-busch.com>
  2194.  
  2195.     * README: Update.
  2196.  
  2197.     * pthread.def (pthread_attr_getstackaddr): uncomment
  2198.     (pthread_attr_setstackaddr): uncomment
  2199.  
  2200. Fri Feb  5 13:42:30 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2201.  
  2202.     * semaphore.c: Comment format changes.
  2203.  
  2204. Thu Feb  4 10:07:28 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2205.  
  2206.     * global.c: Remove ptw32_exception instantiation.
  2207.  
  2208.     * cancel.c (pthread_testcancel): Change C++ exception throw.
  2209.  
  2210.     * implement.h: Remove extern declaration.
  2211.  
  2212. Wed Feb  3 13:04:44 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2213.  
  2214.     * cleanup.c: Rename ptw32_*_cleanup() to pthread_*_cleanup().
  2215.  
  2216.     * pthread.def: Ditto.
  2217.     
  2218.     * pthread.h: Ditto.
  2219.  
  2220.     * pthread.def (pthread_cleanup_push): Remove from export list;
  2221.     the function is defined as a macro under all compilers.
  2222.     (pthread_cleanup_pop): Ditto.
  2223.  
  2224.     * pthread.h: Remove #if defined().
  2225.  
  2226. Wed Feb  3 10:13:48 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2227.  
  2228.     * sync.c (pthread_join): Check for NULL value_ptr arg;
  2229.     check for detached threads.
  2230.  
  2231. Tue Feb  2 18:07:43 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2232.  
  2233.     * implement.h: Add #include <pthread.h>.
  2234.     Change sem_t to ptw32_sem_t.
  2235.  
  2236. Tue Feb  2 18:07:43 1999  Kevin Ruland <Kevin.Ruland@anheuser-busch.com>
  2237.  
  2238.     * signal.c (pthread_sigmask): Add and modify casts.
  2239.     Reverse LHS/RHS bitwise assignments.
  2240.  
  2241.     * pthread.h: Remove #include <semaphore.h>.
  2242.     (PTW32_ATTR_VALID): Add cast.
  2243.     (struct pthread_t_): Add sigmask element.
  2244.  
  2245.     * dll.c: Add "extern C" for DLLMain.
  2246.     (DllMain): Add cast.
  2247.  
  2248.     * create.c (pthread_create): Set sigmask in thread.
  2249.  
  2250.     * condvar.c: Remove #include. Change sem_* to ptw32_sem_*.
  2251.  
  2252.     * attr.c: Changed #include.
  2253.  
  2254.     * Makefile.in: Additional targets and changes to build the library
  2255.     as a DLL.
  2256.  
  2257. Fri Jan 29 11:56:28 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2258.  
  2259.     * Makefile.in (OBJS): Add semaphore.o to list.
  2260.  
  2261.     * semaphore.c (ptw32_sem_timedwait): Move from private.c.
  2262.     Rename sem_* to ptw32_sem_*.
  2263.  
  2264.     * pthread.h (pthread_cond_t): Change type of sem_t.
  2265.     _POSIX_SEMAPHORES no longer defined.
  2266.  
  2267.     * semaphore.h: Contents moved to implement.h.
  2268.     Removed from source tree.
  2269.  
  2270.     * implement.h: Add semaphore function prototypes and rename all
  2271.     functions to prepend 'ptw32_'. They are
  2272.     now private to the pthreads-win32 implementation.
  2273.  
  2274.     * private.c: Change #warning.
  2275.     Move ptw32_sem_timedwait() to semaphore.c.
  2276.  
  2277.     * cleanup.c: Change #warning.
  2278.  
  2279.     * misc.c: Remove #include <errno.h>
  2280.  
  2281.     * pthread.def: Cleanup CVS merge conflicts.
  2282.  
  2283.     * global.c: Ditto.
  2284.  
  2285.     * ChangeLog: Ditto.
  2286.  
  2287.     * cleanup.c: Ditto.
  2288.  
  2289. Sun Jan 24 01:34:52 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2290.  
  2291.     * semaphore.c (sem_wait): Remove second arg to 
  2292.     pthreadCancelableWait() call.
  2293.  
  2294. Sat Jan 23 17:36:40 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2295.  
  2296.     * pthread.def: Add new functions to export list.
  2297.  
  2298.     * pthread.h (PTHREAD_MUTEX_AUTO_CS_NP): New.
  2299.     (PTHREAD_MUTEX_FORCE_CS_NP): New.
  2300.  
  2301.     * README: Updated.
  2302.  
  2303. Fri Jan 22 14:31:59 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2304.  
  2305.     * Makefile.in (CFLAGS): Remove -fhandle-exceptions. Not needed
  2306.     with egcs. Add -g for debugging.
  2307.  
  2308.     * create.c (pthread_create): Replace __stdcall with PT_STDCALL
  2309.     macro. This is a hack and must be fixed.
  2310.  
  2311.     * misc.c (CancelableWait): Remove redundant statement.
  2312.  
  2313.     * mutex.c (pthread_mutexattr_init): Cast calloc return value.
  2314.  
  2315.     * misc.c (CancelableWait): Add cast.
  2316.     (pthread_self): Add cast.
  2317.  
  2318.     * exit.c (pthread_exit): Add cast.
  2319.  
  2320.     * condvar.c (pthread_condattr_init): Cast calloc return value.
  2321.  
  2322.     * cleanup.c: Reorganise conditional compilation.
  2323.  
  2324.     * attr.c (pthread_attr_init): Remove unused 'result'.
  2325.     Cast malloc return value.
  2326.  
  2327.     * private.c (ptw32_callUserDestroyRoutines): Redo conditional
  2328.     compilation.
  2329.  
  2330.     * misc.c (CancelableWait): C++ version uses 'throw'.
  2331.  
  2332.     * cancel.c (pthread_testcancel): Ditto.
  2333.  
  2334.     * implement.h (class ptw32_exception): Define for C++.
  2335.  
  2336.     * pthread.h: Fix C, C++, and Win32 SEH condition compilation
  2337.     mayhem around pthread_cleanup_* defines. C++ version now uses John
  2338.     Bossom's cleanup handlers.
  2339.     (pthread_attr_t): Make 'valid' unsigned.
  2340.     Define '_timeb' as 'timeb' for Ming32.
  2341.     Define PT_STDCALL as nothing for Mingw32. May be temporary.
  2342.  
  2343.     * cancel.c (pthread_testcancel): Cast return value.
  2344.  
  2345. Wed Jan 20 09:31:28 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2346.  
  2347.     * pthread.h (pthread_mutexattr_t): Changed to a pointer.
  2348.  
  2349.     * mutex.c (pthread_mutex_init): Conditionally create Win32 mutex
  2350.     - from John Bossom's implementation.
  2351.     (pthread_mutex_destroy): Conditionally close Win32 mutex
  2352.     - from John Bossom's implementation.
  2353.     (pthread_mutexattr_init): Replaced by John Bossom's version.
  2354.     (pthread_mutexattr_destroy): Ditto.
  2355.     (pthread_mutexattr_getpshared): New function from John Bossom's
  2356.     implementation.
  2357.     (pthread_mutexattr_setpshared): New function from John Bossom's
  2358.     implementation.
  2359.  
  2360. Tue Jan 19 18:27:42 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2361.  
  2362.     * pthread.h (pthreadCancelableTimedWait): New prototype.
  2363.     (pthreadCancelableWait): Remove second argument.
  2364.  
  2365.     * misc.c (CancelableWait): New static function is 
  2366.     pthreadCancelableWait() renamed.
  2367.     (pthreadCancelableWait): Now just calls CancelableWait() with
  2368.     INFINITE timeout.
  2369.     (pthreadCancelableTimedWait): Just calls CancelableWait()
  2370.     with passed in timeout.
  2371.  
  2372. Tue Jan 19 18:27:42 1999  Scott Lightner <scott@curriculum.com>
  2373.  
  2374.     * private.c (ptw32_sem_timedwait): 'abstime' arg really is
  2375.     absolute time. Calculate relative time to wait from current
  2376.     time before passing timeout to new routine 
  2377.     pthreadCancelableTimedWait().
  2378.  
  2379. Tue Jan 19 10:27:39 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2380.  
  2381.     * pthread.h (pthread_mutexattr_setforcecs_np): New prototype.
  2382.     
  2383.     * mutex.c (pthread_mutexattr_init): Init 'pshared' and 'forcecs'
  2384.     attributes to 0.
  2385.     (pthread_mutexattr_setforcecs_np): New function (not portable).
  2386.  
  2387.     * pthread.h (pthread_mutex_t): 
  2388.     Add 'mutex' element. Set to NULL in PTHREAD_MUTEX_INITIALIZER.
  2389.     The pthread_mutex_*() routines will try to optimise performance
  2390.     by choosing either mutexes or critical sections as the basis
  2391.     for pthread mutexes for each indevidual mutex.
  2392.     (pthread_mutexattr_t_): Add 'forcecs' element.
  2393.     Some applications may choose to force use of critical sections
  2394.     if they know that:-
  2395.          the mutex is PROCESS_PRIVATE and, 
  2396.              either the OS supports TryEnterCriticalSection() or
  2397.              pthread_mutex_trylock() will never be called on the mutex.
  2398.     This attribute will be setable via a non-portable routine.
  2399.  
  2400.     Note: We don't yet support PROCESS_SHARED mutexes, so the
  2401.     implementation as it stands will default to Win32 mutexes only if
  2402.     the OS doesn't support TryEnterCriticalSection. On Win9x, and early
  2403.     versions of NT 'forcecs' will need to be set in order to get
  2404.     critical section based mutexes.
  2405.  
  2406. Sun Jan 17 12:01:26 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2407.  
  2408.     * pthread.h (PTHREAD_MUTEX_INITIALIZER): Init new 'staticinit'
  2409.     value to '1' and existing 'valid' value to '1'.
  2410.  
  2411.     * global.c (ptw32_mutex_test_init_lock): Add.
  2412.  
  2413.     * implement.h (ptw32_mutex_test_init_lock.): Add extern.
  2414.  
  2415.     * private.c (ptw32_processInitialize): Init critical section for
  2416.     global lock used by _mutex_check_need_init().
  2417.     (ptw32_processTerminate): Ditto (:s/Init/Destroy/).
  2418.  
  2419.     * dll.c (dllMain): Move call to FreeLibrary() so that it is only
  2420.     called once when the process detaches.
  2421.  
  2422.     * mutex.c (_mutex_check_need_init): New static function to test
  2423.     and init PTHREAD_MUTEX_INITIALIZER mutexes. Provides serialised
  2424.     access to the internal state of the uninitialised static mutex. 
  2425.     Called from pthread_mutex_trylock() and pthread_mutex_lock() which
  2426.     do a quick unguarded test to check if _mutex_check_need_init()
  2427.     needs to be called. This is safe as the test is conservative
  2428.      and is repeated inside the guarded section of 
  2429.     _mutex_check_need_init(). Thus in all calls except the first
  2430.     calls to lock static mutexes, the additional overhead to lock any
  2431.     mutex is a single memory fetch and test for zero.
  2432.  
  2433.     * pthread.h (pthread_mutex_t_): Add 'staticinit' member. Mutexes
  2434.     initialised by PTHREAD_MUTEX_INITIALIZER aren't really initialised
  2435.     until the first attempt to lock it. Using the 'valid'
  2436.     flag (which flags the mutex as destroyed or not) to record this
  2437.     information would be messy. It is possible for a statically
  2438.     initialised mutex such as this to be destroyed before ever being
  2439.     used.
  2440.  
  2441.     * mutex.c (pthread_mutex_trylock): Call _mutex_check_need_init()
  2442.     to test/init PTHREAD_MUTEX_INITIALIZER mutexes.
  2443.     (pthread_mutex_lock): Ditto.
  2444.     (pthread_mutex_unlock): Add check to ensure we don't try to unlock
  2445.     an unitialised static mutex.
  2446.     (pthread_mutex_destroy): Add check to ensure we don't try to delete
  2447.     a critical section that we never created. Allows us to destroy
  2448.     a static mutex that has never been locked (and hence initialised).
  2449.     (pthread_mutex_init): Set 'staticinit' flag to 0 for the new mutex.
  2450.  
  2451. Sun Jan 17 12:01:26 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2452.  
  2453.     * private.c (ptw32_sem_timedwait): Move from semaphore.c.
  2454.  
  2455.     * semaphore.c : Remove redundant #includes.
  2456.     (ptw32_sem_timedwait): Move to private.c.
  2457.     (sem_wait): Add missing abstime arg to pthreadCancelableWait() call.
  2458.  
  2459. Fri Jan 15 23:38:05 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2460.  
  2461.     * condvar.c (cond_timedwait): Remove comment.
  2462.  
  2463. Fri Jan 15 15:41:28 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2464.  
  2465.     * pthread.h: Add new 'abstime' arg to pthreadCancelableWait()
  2466.     prototype.
  2467.  
  2468.     * condvar.c (cond_timedwait): New generalised function called by
  2469.     both pthread_cond_wait() and pthread_cond_timedwait(). This is
  2470.     essentially pthread_cond_wait() renamed and modified to add the
  2471.     'abstime' arg and call the new ptw32_sem_timedwait() instead of
  2472.     sem_wait().
  2473.     (pthread_cond_wait): Now just calls the internal static
  2474.     function cond_timedwait() with an INFINITE wait.
  2475.     (pthread_cond_timedwait): Now implemented. Calls the internal
  2476.     static function cond_timedwait().
  2477.  
  2478.     * implement.h (ptw32_sem_timedwait): New internal function
  2479.     prototype.
  2480.  
  2481.     * misc.c (pthreadCancelableWait): Added new 'abstime' argument
  2482.     to allow shorter than INFINITE wait.
  2483.  
  2484.     * semaphore.c (ptw32_sem_timedwait): New function for internal
  2485.     use.  This is essentially sem_wait() modified to add the
  2486.         'abstime' arg and call the modified (see above)
  2487.         pthreadCancelableWait().
  2488.  
  2489. Thu Jan 14 14:27:13 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2490.  
  2491.     * cleanup.c: Correct _cplusplus to __cplusplus wherever used.
  2492.  
  2493.     * Makefile.in: Add CC=g++ and add -fhandle-exceptions to CFLAGS.
  2494.     The derived Makefile will compile all units of the package as C++
  2495.     so that those which include try/catch exception handling should work
  2496.     properly. The package should compile ok if CC=gcc, however, exception
  2497.     handling will not be included and thus thread cancellation, for
  2498.      example, will not work.
  2499.  
  2500.     * cleanup.c (ptw32_pop_cleanup): Add #warning to compile this
  2501.      file as C++ if using a cygwin32 environment. Perhaps the whole package
  2502.     should be compiled using g++ under cygwin.
  2503.  
  2504.     * private.c (ptw32_threadStart): Change #error directive
  2505.     into #warning and bracket for __CYGWIN__ and derivative compilers.
  2506.  
  2507. Wed Jan 13 09:34:52 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2508.  
  2509.     * build.bat: Delete old binaries before compiling/linking.
  2510.  
  2511. Tue Jan 12 09:58:38 1999  Tor Lillqvist <tml@iki.fi>
  2512.  
  2513.     * dll.c: The Microsoft compiler pragmas probably are more
  2514.     appropriately protected by _MSC_VER than by _WIN32.
  2515.  
  2516.     * pthread.h: Define ETIMEDOUT. This should be returned by
  2517.     pthread_cond_timedwait which is not implemented yet as of
  2518.     snapshot-1999-01-04-1305. It was implemented in the older version.
  2519.     The Microsoft compiler pragmas probably are more appropriately
  2520.     protected by _MSC_VER than by _WIN32.
  2521.  
  2522.     * pthread.def: pthread_mutex_destroy was missing from the def file
  2523.  
  2524.     * condvar.c (pthread_cond_broadcast): Ensure we only wait on threads
  2525.     if there were any waiting on the condition.
  2526.     I think pthread_cond_broadcast should do the WaitForSingleObject
  2527.     only if cv->waiters > 0? Otherwise it seems to hang, at least in the
  2528.     testg thread program from glib.
  2529.  
  2530. Tue Jan 12 09:58:38 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2531.  
  2532.     * condvar.c (pthread_cond_timedwait): Fix function description
  2533.     comments.
  2534.  
  2535.     * semaphore.c (sem_post): Correct typo in comment.
  2536.  
  2537. Mon Jan 11 20:33:19 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2538.  
  2539.     * pthread.h: Re-arrange conditional compile of pthread_cleanup-*
  2540.     macros.
  2541.  
  2542.     * cleanup.c (ptw32_push_cleanup): Provide conditional 
  2543.     compile of cleanup->prev.
  2544.  
  2545. 1999-01-11  Tor Lillqvist <tml@iki.fi>
  2546.  
  2547.     * condvar.c (pthread_cond_init): Invert logic when testing the
  2548.     return value from calloc().
  2549.  
  2550. Sat Jan  9 14:32:08 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2551.  
  2552.     * implement.h: Compile-time switch for CYGWIN derived environments
  2553.     to use CreateThread instead of _beginthreadex. Ditto for ExitThread.
  2554.     Patch provided by Anders Norlander  <anorland@hem2.passagen.se>.
  2555.  
  2556. Tue Jan  5 16:33:04 1999  Ross Johnson  <rpj@swan.canberra.edu.au>
  2557.  
  2558.     * cleanup.c (ptw32_pop_cleanup): Add C++ version of __try/__except
  2559.     block. Move trailing "}" out of #ifdef _WIN32 block left there by
  2560.     (rpj's) mistake.
  2561.  
  2562.     * private.c: Remove #include <errno.h> which is included by pthread.h.
  2563.  
  2564. 1998-12-11  Ben Elliston  <bje@toilet.to.cygnus.com>
  2565.  
  2566.     * README: Update info about subscribing to the mailing list.
  2567.  
  2568. Mon Jan  4 11:23:40 1999  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2569.  
  2570.     * all: No code changes, just cleanup.
  2571.     - remove #if 0 /* Pre Bossom */ enclosed code.
  2572.     - Remove some redundant #includes.
  2573.     * pthread.h: Update implemented/unimplemented routines list.
  2574.     * Tag the bossom merge branch getting ready to merge back to main
  2575.     trunk.
  2576.  
  2577. Tue Dec 29 13:11:16 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2578.  
  2579.     * implement.h: Move the following struct definitions to pthread.h:
  2580.     pthread_t_, pthread_attr_t_, pthread_mutex_t_, pthread_mutex_t_,
  2581.     pthread_mutexattr_t_, pthread_key_t_, pthread_cond_t_,
  2582.     pthread_condattr_t_, pthread_once_t_.
  2583.  
  2584.     * pthread.h: Add "_" prefix to pthread_push_cleanup and 
  2585.     pthread_pop_cleanup internal routines, and associated struct and
  2586.     typedefs.
  2587.  
  2588.     * buildlib.bat: Add compile command for semaphore.c
  2589.  
  2590.     * pthread.def: Comment out pthread_atfork routine name. 
  2591.     Now unimplemented.
  2592.  
  2593.     * tsd.c (pthread_setspecific): Rename tkAssocCreate to
  2594.     ptw32_tkAssocCreate.
  2595.     (pthread_key_delete): Rename tkAssocDestroy to
  2596.     ptw32_tkAssocDestroy.
  2597.  
  2598.     * sync.c (pthread_join): Rename threadDestroy to ptw32_threadDestroy
  2599.  
  2600.     * sched.c (is_attr): attr is now **attr (was *attr), so add extra
  2601.     NULL pointer test.
  2602.     (pthread_attr_setschedparam): Increase redirection for attr which is
  2603.     now a **.
  2604.     (pthread_attr_getschedparam): Ditto.
  2605.     (pthread_setschedparam): Change thread validation and rename "thread"
  2606.      Win32 thread Handle element name to match John Bossom's version.
  2607.     (pthread_getschedparam): Ditto.
  2608.  
  2609.     * private.c (ptw32_threadDestroy): Rename call to
  2610.     callUserDestroyRoutines() as ptw32_callUserDestroyRoutines()
  2611.  
  2612.     * misc.c: Add #include "implement.h".
  2613.  
  2614.     * dll.c: Remove defined(KLUDGE) wrapped code.
  2615.  
  2616.     * fork.c: Remove redefinition of ENOMEM.
  2617.     Remove pthread_atfork() and fork() with #if 0/#endif.
  2618.  
  2619.     * create.c (pthread_create): Rename threadStart and threadDestroy calls
  2620.     to ptw32_threadStart and ptw32_threadDestroy.
  2621.  
  2622.     * implement.h: Rename "detachedstate" to "detachstate".
  2623.  
  2624.     * attr.c: Rename "detachedstate" to "detachstate".
  2625.  
  2626. Mon Dec 28 09:54:39 1998  John Bossom
  2627.  
  2628.     * semaphore.c: Initial version.
  2629.     * semaphore.h: Initial version.
  2630.  
  2631. Mon Dec 28 09:54:39 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2632.  
  2633.     * pthread.h (pthread_attr_t_): Change to *pthread_attr_t.
  2634.  
  2635. Mon Dec 28 09:54:39 1998  John Bossom, Ben Elliston
  2636.  
  2637.     * attr.c (pthread_attr_setstacksize): Merge with John's version.
  2638.     (pthread_attr_getstacksize): Merge with John's version.
  2639.     (pthread_attr_setstackaddr): Merge with John's version.
  2640.     (pthread_attr_getstackaddr): Merge with John's version.
  2641.     (pthread_attr_init): Merge with John's version.
  2642.     (pthread_attr_destroy): Merge with John's version.
  2643.     (pthread_attr_getdetachstate): Merge with John's version.
  2644.     (pthread_attr_setdetachstate): Merge with John's version.
  2645.     (is_attr): attr is now **attr (was *attr), so add extra NULL pointer
  2646.     test.
  2647.  
  2648. Mon Dec 28 09:54:39 1998  Ross Johnson
  2649.  
  2650.     * implement.h (pthread_attr_t_): Add and rename elements in JEB's
  2651.     version to correspond to original, so that it can be used with
  2652.     original attr routines.
  2653.  
  2654.     * pthread.h: Add #endif at end which was truncated in merging.
  2655.  
  2656. Sun Dec 20 14:51:58 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2657.  
  2658.     * misc.c (pthreadCancelableWait): New function by John Bossom. Non-standard
  2659.     but provides a hook that can be used to implement cancellation points in
  2660.     applications that use this library.
  2661.  
  2662.     * pthread.h (pthread_cleanup_pop): C++ (non-WIN32) version uses
  2663.     try/catch to emulate John Bossom's WIN32 __try/__finally behaviour.
  2664.     In the WIN32 version __finally block, add a test for AbnormalTermination otherwise
  2665.     cleanup is only run if the cleanup_pop execute arg is non-zero. Cancellation
  2666.     should cause the cleanup to run irrespective of the execute arg.
  2667.  
  2668.     * condvar.c (pthread_condattr_init): Replaced by John Bossom's version.
  2669.     (pthread_condattr_destroy): Replaced by John Bossom's version.
  2670.     (pthread_condattr_getpshared): Replaced by John Bossom's version.
  2671.     (pthread_condattr_setpshared): Replaced by John Bossom's version.
  2672.     (pthread_cond_init): Replaced by John Bossom's version.
  2673.     Fix comment (refered to mutex rather than condition variable).
  2674.     (pthread_cond_destroy): Replaced by John Bossom's version.
  2675.     (pthread_cond_wait): Replaced by John Bossom's version.
  2676.     (pthread_cond_timedwait): Replaced by John Bossom's version.
  2677.     (pthread_cond_signal): Replaced by John Bossom's version.
  2678.     (pthread_cond_broadcast): Replaced by John Bossom's version.
  2679.  
  2680. Thu Dec 17 19:10:46 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2681.  
  2682.     * tsd.c (pthread_key_create): Replaced by John Bossom's version.
  2683.     (pthread_key_delete): Replaced by John Bossom's version.
  2684.     (pthread_setspecific): Replaced by John Bossom's version.
  2685.     (pthread_getspecific): Replaced by John Bossom's version.
  2686.  
  2687. Mon Dec  7 09:44:40 1998  John Bossom
  2688.  
  2689.     * cancel.c (pthread_setcancelstate): Replaced.
  2690.     (pthread_setcanceltype): Replaced.
  2691.     (pthread_testcancel): Replaced.
  2692.     (pthread_cancel): Replaced.
  2693.     
  2694.     * exit.c (pthread_exit): Replaced.
  2695.  
  2696.     * misc.c (pthread_self): Replaced.
  2697.     (pthread_equal): Replaced.
  2698.  
  2699.     * sync.c (pthread_detach): Replaced.
  2700.     (pthread_join): Replaced.
  2701.  
  2702.     * create.c (pthread_create): Replaced.
  2703.  
  2704.     * private.c (ptw32_processInitialize): New.
  2705.     (ptw32_processTerminate): New.
  2706.     (ptw32_threadStart): New.
  2707.      (ptw32_threadDestroy): New.
  2708.     (ptw32_cleanupStack): New.
  2709.     (ptw32_tkAssocCreate): New.
  2710.     (ptw32_tkAssocDestroy): New.
  2711.     (ptw32_callUserDestroyRoutines): New.
  2712.  
  2713.     * implement.h: Added non-API structures and declarations.
  2714.  
  2715.     * dll.c (PthreadsEntryPoint): Cast return value of GetProcAddress
  2716.     to resolve compile warning from MSVC.
  2717.  
  2718.     * dll.c (DLLmain): Replaced.
  2719.     * dll.c (PthreadsEntryPoint):
  2720.     Re-applied Anders Norlander's patch:-
  2721.     Initialize ptw32_try_enter_critical_section at startup
  2722.     and release kernel32 handle when DLL is being unloaded.
  2723.  
  2724. Sun Dec  6 21:54:35 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2725.  
  2726.     * buildlib.bat: Fix args to CL when building the .DLL
  2727.  
  2728.     * cleanup.c (ptw32_destructor_run_all): Fix TSD key management.
  2729.     This is a tidy-up before TSD and Thread management is completely
  2730.     replaced by John Bossom's code.
  2731.  
  2732.     * tsd.c (pthread_key_create): Fix TSD key management.
  2733.  
  2734.     * global.c (ptw32_key_virgin_next): Initialise.
  2735.  
  2736.     * build.bat: New DOS script to compile and link a pthreads app
  2737.     using Microsoft's CL compiler linker.
  2738.     * buildlib.bat: New DOS script to compile all the object files
  2739.     and create pthread.lib and pthread.dll using Microsoft's CL
  2740.     compiler linker.
  2741.  
  2742. 1998-12-05  Anders Norlander  <anorland@hem2.passagen.se>
  2743.  
  2744.     * implement.h (ptw32_try_enter_critical_section): New extern
  2745.     * dll.c (ptw32_try_enter_critical_section): New pointer to
  2746.     TryEnterCriticalSection if it exists; otherwise NULL.
  2747.     * dll.c (PthreadsEntryPoint):
  2748.     Initialize ptw32_try_enter_critical_section at startup
  2749.     and release kernel32 handle when DLL is being unloaded.
  2750.     * mutex.c (pthread_mutex_trylock): Replaced check for NT with
  2751.     a check if ptw32_try_enter_critical_section is valid
  2752.     pointer to a function. Call ptw32_try_enter_critical_section
  2753.     instead of TryEnterCriticalSection to avoid errors on Win95.
  2754.  
  2755. Thu Dec 3 13:32:00 1998  Ross Johnson  <rpj@ise.canberra.edu.au>
  2756.  
  2757.     * README: Correct cygwin32 compatibility statement.
  2758.  
  2759. Sun Nov 15 21:24:06 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2760.  
  2761.     * cleanup.c (ptw32_destructor_run_all): Declare missing void * arg.
  2762.     Fixup CVS merge conflicts.
  2763.  
  2764. 1998-10-30  Ben Elliston  <bje@cygnus.com>
  2765.  
  2766.     * condvar.c (cond_wait): Fix semantic error. Test for equality
  2767.     instead of making an assignment.
  2768.  
  2769. Fri Oct 30 15:15:50 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  2770.  
  2771.     * cleanup.c (ptw32_handler_push): Fixed bug appending new
  2772.     handler to list reported by Peter Slacik
  2773.     <Peter.Slacik@leibinger.freinet.de>.
  2774.     (new_thread): Rename poorly named local variable to
  2775.     "new_handler".
  2776.  
  2777. Sat Oct 24 18:34:59 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2778.  
  2779.     * global.c: Add TSD key management array and index declarations.
  2780.  
  2781.     * implement.h: Ditto for externs.
  2782.  
  2783. Fri Oct 23 00:08:09 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2784.  
  2785.     * implement.h (PTW32_TSD_KEY_REUSE): Add enum.
  2786.  
  2787.     * private.c (ptw32_delete_thread): Add call to
  2788.     ptw32_destructor_run_all() to clean up the threads keys.
  2789.  
  2790.     * cleanup.c (ptw32_destructor_run_all): Check for no more dirty
  2791.     keys to run destructors on. Assume that the destructor call always
  2792.     succeeds and set the key value to NULL.
  2793.  
  2794. Thu Oct 22 21:44:44 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2795.  
  2796.     * tsd.c (pthread_setspecific): Add key management code.
  2797.     (pthread_key_create): Ditto.
  2798.     (pthread_key_delete): Ditto.
  2799.  
  2800.     * implement.h (struct ptw32_tsd_key): Add status member.
  2801.  
  2802.     * tsd.c: Add description of pthread_key_delete() from the
  2803.     standard as a comment.
  2804.  
  2805. Fri Oct 16 17:38:47 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  2806.  
  2807.     * cleanup.c (ptw32_destructor_run_all): Fix and improve
  2808.     stepping through the key table.
  2809.  
  2810. Thu Oct 15 14:05:01 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  2811.  
  2812.     * private.c (ptw32_new_thread): Remove init of destructorstack.
  2813.     No longer an element of pthread_t.
  2814.  
  2815.     * tsd.c (pthread_setspecific): Fix type declaration and cast.
  2816.     (pthread_getspecific): Ditto.
  2817.     (pthread_getspecific): Change error return value to NULL if key
  2818.     is not in use.
  2819.  
  2820. Thu Oct 15 11:53:21 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2821.  
  2822.     * global.c (ptw32_tsd_key_table): Fix declaration.
  2823.  
  2824.     * implement.h(ptw32_TSD_keys_TlsIndex): Add missing extern.
  2825.     (ptw32_tsd_mutex): Ditto.
  2826.  
  2827.     * create.c (ptw32_start_call): Fix "keys" array declaration.
  2828.     Add comment.
  2829.  
  2830.     * tsd.c (pthread_setspecific): Fix type declaration and cast.
  2831.     (pthread_getspecific): Ditto.
  2832.  
  2833.     * cleanup.c (ptw32_destructor_run_all): Declare missing loop
  2834.     counter.
  2835.  
  2836. Wed Oct 14 21:09:24 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2837.  
  2838.     * private.c (ptw32_new_thread): Increment ptw32_threads_count.
  2839.     (ptw32_delete_thread): Decrement ptw32_threads_count.
  2840.     Remove some comments.
  2841.  
  2842.     * exit.c (ptw32_exit): : Fix two pthread_mutex_lock() calls that
  2843.      should have been pthread_mutex_unlock() calls.
  2844.     (ptw32_vacuum): Remove call to ptw32_destructor_pop_all().
  2845.  
  2846.     * create.c (pthread_create): Fix two pthread_mutex_lock() calls that
  2847.      should have been pthread_mutex_unlock() calls.
  2848.  
  2849.     * global.c (ptw32_tsd_mutex): Add mutex for TSD operations.
  2850.  
  2851.     * tsd.c (pthread_key_create): Add critical section.
  2852.     (pthread_setspecific): Ditto.
  2853.     (pthread_getspecific): Ditto.
  2854.     (pthread_key_delete): Ditto.
  2855.  
  2856.     * sync.c (pthread_join): Fix two pthread_mutex_lock() calls that
  2857.      should have been pthread_mutex_unlock() calls.
  2858.  
  2859. Mon Oct 12 00:00:44 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2860.  
  2861.     * implement.h (ptw32_tsd_key_table): New.
  2862.  
  2863.     * create.c (ptw32_start_call): Initialise per-thread TSD keys
  2864.     to NULL.
  2865.  
  2866.     * misc.c (pthread_once): Correct typo in comment.
  2867.  
  2868.     * implement.h (ptw32_destructor_push): Remove.
  2869.     (ptw32_destructor_pop): Remove.
  2870.     (ptw32_destructor_run_all): Rename from ptw32_destructor_pop_all.
  2871.     (PTW32_TSD_KEY_DELETED): Add enum.
  2872.     (PTW32_TSD_KEY_INUSE): Add enum.
  2873.  
  2874.     * cleanup.c (ptw32_destructor_push): Remove.
  2875.     (ptw32_destructor_pop): Remove.
  2876.     (ptw32_destructor_run_all): Totally revamped TSD.
  2877.  
  2878.     * dll.c (ptw32_TSD_keys_TlsIndex): Initialise.
  2879.  
  2880.     * tsd.c (pthread_setspecific): Totally revamped TSD.
  2881.     (pthread_getspecific): Ditto.
  2882.     (pthread_create): Ditto.
  2883.     (pthread_delete): Ditto.
  2884.  
  2885. Sun Oct 11 22:44:55 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2886.  
  2887.     * global.c (ptw32_tsd_key_table): Add new global.
  2888.  
  2889.     * implement.h (ptw32_tsd_key_t and struct ptw32_tsd_key):
  2890.     Add.
  2891.     (struct _pthread): Remove destructorstack.
  2892.  
  2893.     * cleanup.c (ptw32_destructor_run_all): Rename from
  2894.      ptw32_destructor_pop_all. The key destructor stack was made
  2895.      global rather than per-thread. No longer removes destructor nodes
  2896.     from the stack. Comments updated.
  2897.  
  2898. 1998-10-06  Ben Elliston  <bje@cygnus.com>
  2899.  
  2900.     * condvar.c (cond_wait): Use POSIX, not Win32 mutex calls.
  2901.     (pthread_cond_broadcast): Likewise.
  2902.     (pthread_cond_signal): Likewise.
  2903.  
  2904. 1998-10-05  Ben Elliston  <bje@cygnus.com>
  2905.  
  2906.     * pthread.def: Update. Some functions aren't available yet, others
  2907.     are macros in <pthread.h>.
  2908.  
  2909.     * tests/join.c: Remove; useless.
  2910.  
  2911. Mon Oct  5 14:25:08 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  2912.  
  2913.     * pthread.def: New file for building the DLL.
  2914.  
  2915. 1998-10-05  Ben Elliston  <bje@cygnus.com>
  2916.  
  2917.     * misc.c (pthread_equal): Correct inverted logic bug.
  2918.     (pthread_once): Use the POSIX mutex primitives, not Win32. Remove
  2919.     irrelevant FIXME comment.
  2920.  
  2921.     * global.c (PTHREAD_MUTEX_INITIALIZER): Move to pthread.h.
  2922.  
  2923.     * pthread.h (PTHREAD_MUTEX_INITIALIZER): Define.
  2924.     (pthread_mutex_t): Reimplement as a struct containing a valid
  2925.     flag. If the flag is ever down upon entry to a mutex operation,
  2926.     we call pthread_mutex_create() to initialise the object. This
  2927.     fixes the problem of how to handle statically initialised objects
  2928.     that can't call InitializeCriticalSection() due to their context.
  2929.     (PTHREAD_ONCE_INIT): Define.
  2930.  
  2931.     * mutex.c (pthread_mutex_init): Set valid flag.
  2932.     (pthread_mutex_destroy): Clear valid flag.
  2933.     (pthread_mutex_lock): Check and handle the valid flag.
  2934.     (pthread_mutex_unlock): Likewise.
  2935.     (pthread_mutex_trylock): Likewise.
  2936.  
  2937.     * tests/mutex3.c: New file; test for the static initialisation
  2938.     macro. Passes.
  2939.  
  2940.     * tests/create1.c: New file; test pthread_create(). Passes.
  2941.     
  2942.     * tests/equal.c: Poor test; remove.
  2943.     
  2944.     * tests/equal1.c New file; test pthread_equal(). Passes.
  2945.  
  2946.     * tests/once1.c: New file; test for pthread_once(). Passes.
  2947.  
  2948.     * tests/self.c: Remove; rename to self1.c.
  2949.  
  2950.     * tests/self1.c: This is the old self.c.
  2951.  
  2952.     * tests/self2.c: New file. Test pthread_self() with a single
  2953.     thread. Passes.
  2954.  
  2955.     * tests/self3.c: New file. Test pthread_self() with a couple of
  2956.     threads to ensure their thread IDs differ. Passes.
  2957.     
  2958. 1998-10-04  Ben Elliston  <bje@cygnus.com>
  2959.  
  2960.     * tests/mutex2.c: Test pthread_mutex_trylock(). Passes.
  2961.  
  2962.     * tests/mutex1.c: New basic test for mutex functions (it passes).
  2963.     (main): Eliminate warning.
  2964.  
  2965.     * configure.in: Test for __stdcall, not _stdcall. Typo.
  2966.  
  2967.     * configure: Regenerate.
  2968.  
  2969.     * attr.c (pthread_attr_setstackaddr): Remove FIXME comment. Win32
  2970.     does know about ENOSYS after all.
  2971.     (pthread_attr_setstackaddr): Likewise.
  2972.  
  2973. 1998-10-03  Ben Elliston  <bje@cygnus.com>
  2974.  
  2975.     * configure.in: Test for the `_stdcall' keyword.  Define `STDCALL'
  2976.     to `_stdcall' if we have it, null otherwise.
  2977.  
  2978.     * configure: Regenerate.
  2979.  
  2980.     * acconfig.h (STDCALL): New define.
  2981.  
  2982.     * config.h.in: Regenerate.
  2983.  
  2984.     * create.c (ptw32_start_call): Add STDCALL prefix.
  2985.     
  2986.     * mutex.c (pthread_mutex_init): Correct function signature.
  2987.  
  2988.     * attr.c (pthread_attr_init): Only zero out the `sigmask' member
  2989.     if we have the sigset_t type.
  2990.  
  2991.     * pthread.h: No need to include <unistd.h>.  It doesn't even exist
  2992.     on Win32! Again, an artifact of cross-compilation.    
  2993.     (pthread_sigmask): Only provide if we have the sigset_t type.
  2994.  
  2995.     * process.h: Remove. This was a stand-in before we started doing
  2996.     native compilation under Win32.
  2997.  
  2998.     * pthread.h (pthread_mutex_init): Make `attr' argument const.
  2999.  
  3000. 1998-10-02  Ben Elliston  <bje@cygnus.com>
  3001.  
  3002.     * COPYING: Remove.
  3003.  
  3004.     * COPYING.LIB: Add. This library is under the LGPL.
  3005.  
  3006. 1998-09-13  Ben Elliston  <bje@cygnus.com>
  3007.  
  3008.     * configure.in: Test for required system features.
  3009.  
  3010.     * configure: Generate. 
  3011.  
  3012.     * acconfig.h: New file.
  3013.  
  3014.     * config.h.in: Generate.
  3015.  
  3016.     * Makefile.in: Renamed from Makefile.
  3017.  
  3018.     * COPYING: Import from a recent GNU package.
  3019.  
  3020.     * config.guess: Likewise.
  3021.  
  3022.     * config.sub: Likewise.
  3023.  
  3024.     * install-sh: Likewise.
  3025.  
  3026.     * config.h: Remove.  
  3027.  
  3028.     * Makefile: Likewise.
  3029.  
  3030. 1998-09-12  Ben Elliston  <bje@cygnus.com>
  3031.  
  3032.     * windows.h: No longer needed; remove.
  3033.  
  3034.     * windows.c: Likewise.
  3035.  
  3036. Sat Sep 12 20:09:24 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3037.  
  3038.     * windows.h: Remove error number definitions. These are in <errno.h>
  3039.     
  3040.     * tsd.c: Add comment explaining rationale for not building
  3041.     POSIX TSD on top of Win32 TLS.
  3042.  
  3043. 1998-09-12  Ben Elliston  <bje@cygnus.com>
  3044.  
  3045.     * {most}.c: Include <errno.h> to get POSIX error values.
  3046.  
  3047.     * signal.c (pthread_sigmask): Only provide if HAVE_SIGSET_T is
  3048.     defined.
  3049.  
  3050.     * config.h: #undef features, don't #define them.  This will be
  3051.     generated by autoconf very soon.
  3052.     
  3053. 1998-08-11  Ben Elliston  <bje@cygnus.com>
  3054.  
  3055.     * Makefile (LIB): Define.
  3056.     (clean): Define target.
  3057.     (all): Build a library not just the object files.
  3058.  
  3059.     * pthread.h: Provide a definition for struct timespec if we don't
  3060.     already have one.
  3061.  
  3062.     * windows.c (TlsGetValue): Bug fix.
  3063.     
  3064. Thu Aug  6 15:19:22 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3065.  
  3066.     * misc.c (pthread_once): Fix arg 1 of EnterCriticalSection()
  3067.      and LeaveCriticalSection() calls to pass address-of lock.
  3068.  
  3069.     * fork.c (pthread_atfork): Typecast (void (*)(void *)) funcptr
  3070.     in each ptw32_handler_push() call.
  3071.  
  3072.     * exit.c (ptw32_exit): Fix attr arg in 
  3073.     pthread_attr_getdetachstate() call.
  3074.  
  3075.     * private.c (ptw32_new_thread): Typecast (HANDLE) NULL.
  3076.     (ptw32_delete_thread): Ditto.
  3077.  
  3078.     * implement.h: (PTW32_MAX_THREADS): Add define. This keeps
  3079.     changing in an attempt to make thread administration data types
  3080.     opaque and cleanup DLL startup.
  3081.  
  3082.     * dll.c (PthreadsEntryPoint): 
  3083.     (ptw32_virgins): Remove malloc() and free() calls.
  3084.     (ptw32_reuse): Ditto.
  3085.     (ptw32_win32handle_map): Ditto.
  3086.     (ptw32_threads_mutex_table): Ditto.
  3087.  
  3088.     * global.c (_POSIX_THREAD_THREADS_MAX): Initialise with 
  3089.     PTW32_MAX_THREADS.
  3090.     (ptw32_virgins): Ditto.
  3091.     (ptw32_reuse): Ditto.
  3092.     (ptw32_win32handle_map): Ditto.
  3093.     (ptw32_threads_mutex_table): Ditto.
  3094.  
  3095.     * create.c (pthread_create): Typecast (HANDLE) NULL.
  3096.     Typecast (unsigned (*)(void *)) start_routine.
  3097.  
  3098.     * condvar.c (pthread_cond_init): Add address-of operator & to
  3099.     arg 1 of pthread_mutex_init() call.
  3100.     (pthread_cond_destroy): Add address-of operator & to
  3101.     arg 1 of pthread_mutex_destroy() call. 
  3102.  
  3103.     * cleanup.c (ptw32_destructor_pop_all): Add (int) cast to 
  3104.     pthread_getspecific() arg.
  3105.     (ptw32_destructor_pop): Add (void *) cast to "if" conditional.
  3106.     (ptw32_destructor_push): Add (void *) cast to
  3107.     ptw32_handler_push() "key" arg.
  3108.     (malloc.h): Add include.
  3109.  
  3110.     * implement.h (ptw32_destructor_pop): Add prototype.
  3111.  
  3112.     * tsd.c (implement.h): Add include.
  3113.  
  3114.     * sync.c (pthread_join): Remove target_thread_mutex and it's
  3115.     initialisation. Rename getdetachedstate to getdetachstate.
  3116.     Remove unused variable "exitcode".
  3117.     (pthread_detach): Remove target_thread_mutex and it's
  3118.     initialisation. Rename getdetachedstate to getdetachstate.
  3119.     Rename setdetachedstate to setdetachstate.
  3120.  
  3121.     * signal.c (pthread_sigmask): Rename SIG_SET to SIG_SETMASK.
  3122.     Cast "set" to (long *) in assignment to passify compiler warning.
  3123.     Add address-of operator & to thread->attr.sigmask in memcpy() call
  3124.     and assignment.
  3125.     (pthread_sigmask): Add address-of operator & to thread->attr.sigmask
  3126.     in memcpy() call and assignment.
  3127.  
  3128.     * windows.h (THREAD_PRIORITY_ERROR_RETURN): Add.
  3129.     (THREAD_PRIORITY_LOWEST): Add.
  3130.     (THREAD_PRIORITY_HIGHEST): Add.
  3131.  
  3132.     * sched.c (is_attr): Add function.
  3133.     (implement.h): Add include.
  3134.     (pthread_setschedparam): Rename all instances of "sched_policy"
  3135.     to "sched_priority".
  3136.     (pthread_getschedparam): Ditto.
  3137.  
  3138. Tue Aug  4 16:57:58 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3139.  
  3140.     * private.c (ptw32_delete_thread): Fix typo. Add missing ';'.
  3141.  
  3142.     * global.c (ptw32_virgins): Change types from pointer to 
  3143.     array pointer.
  3144.     (ptw32_reuse): Ditto.
  3145.     (ptw32_win32handle_map): Ditto.
  3146.     (ptw32_threads_mutex_table): Ditto.
  3147.  
  3148.     * implement.h(ptw32_virgins): Change types from pointer to 
  3149.     array pointer.
  3150.     (ptw32_reuse): Ditto.
  3151.     (ptw32_win32handle_map): Ditto.
  3152.     (ptw32_threads_mutex_table): Ditto.
  3153.  
  3154.     * private.c (ptw32_delete_thread): Fix "entry" should be "thread".
  3155.  
  3156.     * misc.c (pthread_self): Add extern for ptw32_threadID_TlsIndex.
  3157.  
  3158.     * global.c: Add comment.
  3159.  
  3160.     * misc.c (pthread_once): Fix member -> dereferences.
  3161.     Change ptw32_once_flag to once_control->flag in "if" test.
  3162.  
  3163. Tue Aug  4 00:09:30 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3164.  
  3165.     * implement.h(ptw32_virgins): Add extern.
  3166.     (ptw32_virgin_next): Ditto.
  3167.     (ptw32_reuse): Ditto.
  3168.     (ptw32_reuse_top): Ditto.
  3169.     (ptw32_win32handle_map): Ditto.
  3170.     (ptw32_threads_mutex_table): Ditto.
  3171.  
  3172.     * global.c (ptw32_virgins): Changed from array to pointer.
  3173.     Storage allocation for the array moved into dll.c.
  3174.     (ptw32_reuse): Ditto.
  3175.     (ptw32_win32handle_map): Ditto.
  3176.     (ptw32_threads_mutex_table): Ditto.
  3177.  
  3178.     * dll.c (PthreadsEntryPoint): Set up thread admin storage when
  3179.     DLL is loaded.
  3180.  
  3181.     * fork.c (pthread_atfork): Fix function pointer arg to all
  3182.     ptw32_handler_push() calls. Change "arg" arg to NULL in child push.
  3183.  
  3184.     * exit.c: Add windows.h and process.h includes.
  3185.     (ptw32_exit): Add local detachstate declaration.
  3186.     (ptw32_exit): Fix incorrect name for pthread_attr_getdetachstate().
  3187.  
  3188.     * pthread.h (_POSIX_THREAD_ATTR_STACKSIZE): Move from global.c
  3189.     (_POSIX_THREAD_ATTR_STACKADDR): Ditto.
  3190.  
  3191.     * create.c (pthread_create): Fix #if should be #ifdef.
  3192.     (ptw32_start_call): Remove usused variables.
  3193.  
  3194.     * process.h: Create.
  3195.  
  3196.     * windows.h: Move _beginthreadex and _endthreadex into
  3197.     process.h
  3198.  
  3199. Mon Aug  3 21:19:57 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3200.  
  3201.     * condvar.c (pthread_cond_init): Add NULL attr to
  3202.     pthread_mutex_init() call - default attributes will be used.
  3203.     (cond_wait): Fix typo.
  3204.     (cond_wait): Fix typo - cv was ev.
  3205.     (pthread_cond_broadcast): Fix two identical typos.
  3206.  
  3207.     * cleanup.c (ptw32_destructor_pop_all): Remove _ prefix from
  3208.     PTHREAD_DESTRUCTOR_ITERATIONS.
  3209.  
  3210.     * pthread.h: Move _POSIX_* values into posix.h
  3211.  
  3212.     * pthread.h: Fix typo in pthread_mutex_init() prototype.
  3213.  
  3214.     * attr.c (pthread_attr_init): Fix error in priority member init.
  3215.  
  3216.     * windows.h (THREAD_PRIORITY_NORMAL): Add.
  3217.  
  3218.     * pthread.h (sched_param): Add missing ';' to struct definition. 
  3219.  
  3220.     * attr.c (pthread_attr_init): Remove obsolete pthread_attr_t
  3221.     member initialisation - cancelstate, canceltype, cancel_pending.
  3222.     (is_attr): Make arg "attr" a const.
  3223.  
  3224.     * implement.h (PTW32_HANDLER_POP_LIFO): Remove definition.
  3225.     (PTW32_HANDLER_POP_FIFO): Ditto.
  3226.     (PTW32_VALID): Add missing newline escape (\).
  3227.     (ptw32_handler_node): Make element "next" a pointer.
  3228.  
  3229. 1998-08-02  Ben Elliston  <bje@cygnus.com>
  3230.  
  3231.     * windows.h: Remove duplicate TlsSetValue() prototype.  Add 
  3232.     TlsGetValue() prototype.
  3233.     (FALSE): Define.
  3234.     (TRUE): Likewise.
  3235.     Add forgotten errno values.  Guard against multiple #includes.
  3236.  
  3237.     * windows.c: New file.  Implement stubs for Win32 functions.
  3238.  
  3239.     * Makefile (SRCS): Remove.  Not explicitly needed.
  3240.     (CFLAGS): Add -Wall for all warnings with GCC.
  3241.  
  3242. Sun Aug  2 19:03:42 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3243.  
  3244.     * config.h: Create. This is a temporary stand-in for autoconf yet
  3245.     to be done.
  3246.      (HAVE_SIGNAL_H): Add.
  3247.  
  3248.     * pthread.h: Minor rearrangement for temporary config.h.
  3249.  
  3250. Fri Jul 31 14:00:29 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3251.  
  3252.     * cleanup.c (ptw32_destructor_pop): Implement. Removes
  3253.     destructors associated with a key without executing them.
  3254.     (ptw32_destructor_pop_all): Add FIXME comment.
  3255.  
  3256.     * tsd.c (pthread_key_delete): Add call to ptw32_destructor_pop().
  3257.  
  3258. Fri Jul 31 00:05:45 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3259.  
  3260.     * tsd.c (pthread_key_create): Update to properly associate
  3261.     the destructor routine with the key.
  3262.     (pthread_key_delete): Add FIXME comment.
  3263.  
  3264.     * exit.c (ptw32_vacuum): Add call to
  3265.     ptw32_destructor_pop_all().
  3266.  
  3267.     * implement.h (ptw32_handler_pop_all): Add prototype.
  3268.     (ptw32_destructor_pop_all): Ditto.
  3269.  
  3270.     * cleanup.c (ptw32_destructor_push): Implement. This is just a
  3271.     call to ptw32_handler_push().
  3272.     (ptw32_destructor_pop_all): Implement. This is significantly
  3273.     different to ptw32_handler_pop_all().
  3274.  
  3275.     * Makefile (SRCS): Create. Preliminary.
  3276.  
  3277.     * windows.h: Create. Contains Win32 definitions for compile
  3278.     testing. This is just a standin for the real one.
  3279.  
  3280.     * pthread.h (SIG_UNBLOCK): Fix typo. Was SIG_BLOCK.
  3281.     (windows.h): Add include. Required for CRITICAL_SECTION.
  3282.     (pthread_cond_t): Move enum declaration outside of struct
  3283.     definition.
  3284.     (unistd.h): Add include - may be temporary.
  3285.  
  3286.     * condvar.c (windows.h): Add include.
  3287.  
  3288.     * implement.h (PTW32_THIS): Remove - no longer required.
  3289.     (PTW32_STACK): Use pthread_self() instead of PTW32_THIS.
  3290.  
  3291. Thu Jul 30 23:12:45 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3292.  
  3293.     * implement.h: Remove ptw32_find_entry() prototype.
  3294.  
  3295.     * private.c: Extend comments.
  3296.     Remove ptw32_find_entry() - no longer needed.
  3297.  
  3298.     * create.c (ptw32_start_call): Add call to TlsSetValue() to
  3299.     store the thread ID.
  3300.  
  3301.     * dll.c (PthreadsEntryPoint): Implement. This is called
  3302.     whenever a process loads the DLL. Used to initialise thread
  3303.     local storage.
  3304.  
  3305.     * implement.h: Add ptw32_threadID_TlsIndex.
  3306.     Add ()s around PTW32_VALID expression.
  3307.  
  3308.     * misc.c (pthread_self): Re-implement using Win32 TLS to store
  3309.     the threads own ID.
  3310.  
  3311. Wed Jul 29 11:39:03 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3312.  
  3313.     * private.c: Corrections in comments.
  3314.     (ptw32_new_thread): Alter "if" flow to be more natural.
  3315.  
  3316.     * cleanup.c (ptw32_handler_push): Same as below.
  3317.  
  3318.     * create.c (pthread_create): Same as below.
  3319.  
  3320.     * private.c (ptw32_new_thread): Rename "new" to "new_thread".
  3321.     Since when has a C programmer been required to know C++?
  3322.  
  3323. Tue Jul 28 14:04:29 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3324.  
  3325.     * implement.h: Add PTW32_VALID macro.
  3326.  
  3327.     * sync.c (pthread_join): Modify to use the new thread
  3328.     type and ptw32_delete_thread(). Rename "target" to "thread".
  3329.     Remove extra local variable "target".
  3330.     (pthread_detach): Ditto.
  3331.  
  3332.     * signal.c (pthread_sigmask): Move init of "us" out of inner block.
  3333.     Fix instance of "this" should have been "us". Rename "us" to "thread".
  3334.  
  3335.     * sched.c (pthread_setschedparam): Modify to use the new thread
  3336.     type.
  3337.     (pthread_getschedparam): Ditto.
  3338.  
  3339.     * private.c (ptw32_find_thread): Fix return type and arg.
  3340.  
  3341.     * implement.h: Remove PTW32_YES and PTW32_NO.
  3342.     (ptw32_new_thread): Add prototype.
  3343.     (ptw32_find_thread): Ditto.
  3344.     (ptw32_delete_thread): Ditto.
  3345.     (ptw32_new_thread_entry): Remove prototype.
  3346.     (ptw32_find_thread_entry): Ditto.
  3347.     (ptw32_delete_thread_entry): Ditto.
  3348.     (  PTW32_NEW, PTW32_INUSE, PTW32_EXITED, PTW32_REUSE):
  3349.     Add.
  3350.  
  3351.  
  3352.     * create.c (pthread_create): Minor rename "us" to "new" (I need
  3353.     these cues but it doesn't stop me coming out with some major bugs
  3354.     at times).
  3355.     Load start_routine and arg into the thread so the wrapper can
  3356.     call it.
  3357.  
  3358.     * exit.c (pthread_exit): Fix pthread_this should be pthread_self.
  3359.  
  3360.     * cancel.c (pthread_setcancelstate): Change
  3361.      ptw32_threads_thread_t * to pthread_t and init with
  3362.      pthread_this().
  3363.     (pthread_setcanceltype): Ditto.
  3364.  
  3365.     * exit.c (ptw32_exit): Add new pthread_t arg.
  3366.     Rename ptw32_delete_thread_entry to ptw32_delete_thread.
  3367.     Rename "us" to "thread".
  3368.     (pthread_exit): Call ptw32_exit with added thread arg.
  3369.  
  3370.     * create.c (ptw32_start_call): Insert missing ")".
  3371.     Add "us" arg to ptw32_exit() call.
  3372.     (pthread_create): Modify to use new thread allocation scheme.
  3373.  
  3374.     * private.c: Added detailed explanation of the new thread
  3375.     allocation scheme.
  3376.     (ptw32_new_thread): Totally rewritten to use
  3377.     new thread allocation scheme.
  3378.     (ptw32_delete_thread): Ditto.
  3379.     (ptw32_find_thread): Obsolete.
  3380.  
  3381. Mon Jul 27 17:46:37 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3382.  
  3383.     * create.c (pthread_create): Start of rewrite. Not completed yet.
  3384.  
  3385.     * private.c (ptw32_new_thread_entry): Start of rewrite. Not
  3386.     complete.
  3387.  
  3388.     * implement.h (ptw32_threads_thread): Rename, remove thread
  3389.     member, add win32handle and ptstatus members.
  3390.     (ptw32_t): Add.
  3391.  
  3392.     * pthread.h: pthread_t is no longer mapped directly to a Win32
  3393.     HANDLE type. This is so we can let the Win32 thread terminate and
  3394.     reuse the HANDLE while pthreads holds it's own thread ID until
  3395.     the last waiting join exits.
  3396.  
  3397. Mon Jul 27 00:20:37 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3398.  
  3399.     * private.c (ptw32_delete_thread_entry): Destroy the thread
  3400.      entry attribute object before deleting the thread entry itself.
  3401.  
  3402.     * attr.c (pthread_attr_init): Initialise cancel_pending = FALSE.
  3403.     (pthread_attr_setdetachstate): Rename "detached" to "detachedstate".
  3404.     (pthread_attr_getdetachstate): Ditto.
  3405.  
  3406.     * exit.c (ptw32_exit): Fix incorrect check for detachedstate.
  3407.  
  3408.     * implement.h (ptw32_call_t): Remove env member. 
  3409.  
  3410. Sun Jul 26 13:06:12 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3411.  
  3412.     * implement.h (ptw32_new_thread_entry): Fix prototype.
  3413.     (ptw32_find_thread_entry): Ditto.
  3414.     (ptw32_delete_thread_entry): Ditto.
  3415.     (ptw32_exit): Add prototype.
  3416.  
  3417.     * exit.c (ptw32_exit): New function. Called from pthread_exit()
  3418.     and ptw32_start_call() to exit the thread. It allows an extra
  3419.     argument which is the return code passed to _endthreadex().
  3420.     (ptw32_exit): Move thread entry delete call from ptw32_vacuum()
  3421.     into here. Add more explanation of thread entry deletion.
  3422.     (ptw32_exit): Clarify comment.
  3423.  
  3424.     * create.c (ptw32_start_call): Change pthread_exit() call to
  3425.     ptw32_exit() call.
  3426.  
  3427.     * exit.c (ptw32_vacuum): Add thread entry deletion code
  3428.     moved from ptw32_start_call(). See next item.
  3429.     (pthread_exit): Remove longjmp(). Add mutex lock around thread table
  3430.     manipulation code. This routine now calls _enthreadex().
  3431.  
  3432.     * create.c (ptw32_start_call): Remove setjmp() call and move
  3433.     cleanup code out. Call pthread_exit(NULL) to terminate the thread.
  3434.  
  3435. 1998-07-26  Ben Elliston  <bje@cygnus.com>
  3436.  
  3437.     * tsd.c (pthread_getspecific): Update comments.
  3438.  
  3439.     * mutex.c (pthread_mutexattr_setpshared): Not supported; remove.
  3440.     (pthread_mutexattr_getpshared): Likewise.
  3441.  
  3442.     * pthread.h (pthread_mutexattr_setpshared): Remove prototype.
  3443.     (pthread_mutexattr_getpshared): Likewise.
  3444.  
  3445. Sun Jul 26 00:09:59 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3446.  
  3447.     * sync.c: Rename all instances of ptw32_count_mutex to
  3448.     ptw32_table_mutex.
  3449.  
  3450.     * implement.h: Rename ptw32_count_mutex to
  3451.     ptw32_table_mutex.
  3452.  
  3453.     * global.c: Rename ptw32_count_mutex to
  3454.     ptw32_table_mutex.
  3455.  
  3456.     * create.c (pthread_create): Add critical sections.
  3457.     (ptw32_start_call): Rename ptw32_count_mutex to
  3458.     ptw32_table_mutex.
  3459.  
  3460.     * cancel.c (pthread_setcancelstate): Fix indirection bug and rename
  3461.     "this" to "us".
  3462.  
  3463.     * signal.c (pthread_sigmask): Rename "this" to "us" and fix some
  3464.     minor syntax errors. Declare "us" and initialise it.
  3465.  
  3466.     * sync.c (pthread_detach): Rename "this" to "target".
  3467.  
  3468.     * pthread.h: Converting PTHREAD_* defines to alias the (const int)
  3469.     values in global.c.
  3470.  
  3471.     * global.c: Started converting PTHREAD_* defines to (const int) as
  3472.      a part of making the eventual pthreads DLL binary compatible
  3473.      through version changes.
  3474.  
  3475.     * condvar.c (cond_wait): Add cancelation point. This applies the
  3476.     point to both pthread_cond_wait() and pthread_cond_timedwait().
  3477.  
  3478.     * exit.c (pthread_exit): Rename "this" to "us".
  3479.  
  3480.     * implement.h: Add comment.
  3481.  
  3482.     * sync.c (pthread_join): I've satisfied myself that pthread_detach()
  3483.     does set the detached attribute in the thread entry attributes
  3484.     to PTHREAD_CREATE_DETACHED. "if" conditions were changed to test
  3485.     that attribute instead of a separate flag.
  3486.  
  3487.     * create.c (pthread_create): Rename "this" to "us".
  3488.     (pthread_create): cancelstate and canceltype are not attributes
  3489.     so the copy to thread entry attribute storage was removed.
  3490.     Only the thread itself can change it's cancelstate or canceltype,
  3491.     ie. the thread must exist already.
  3492.  
  3493.     * private.c (ptw32_delete_thread_entry): Mutex locks removed.
  3494.     Mutexes must be applied at the caller level.
  3495.     (ptw32_new_thread_entry): Ditto.
  3496.     (ptw32_new_thread_entry): Init cancelstate, canceltype, and
  3497.     cancel_pending to default values.
  3498.     (ptw32_new_thread_entry): Rename "this" to "new".
  3499.     (ptw32_find_thread_entry): Rename "this" to "entry".
  3500.     (ptw32_delete_thread_entry): Rename "thread_entry" to "entry".
  3501.  
  3502.     * create.c (ptw32_start_call): Mutexes changed to
  3503.     ptw32_count_mutex. All access to the threads table entries is
  3504.     under the one mutex. Otherwise chaos reigns.
  3505.  
  3506. Sat Jul 25 23:16:51 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3507.  
  3508.     * implement.h (ptw32_threads_thread): Move cancelstate and
  3509.      canceltype members out of pthread_attr_t into here.
  3510.  
  3511.     * fork.c (fork): Add comment.
  3512.  
  3513. 1998-07-25  Ben Elliston  <bje@cygnus.com>
  3514.  
  3515.     * fork.c (fork): Autoconfiscate.
  3516.  
  3517. Sat Jul 25 00:00:13 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3518.  
  3519.     * create.c (ptw32_start_call): Set thread priority.  Ensure our
  3520.      thread entry is removed from the thread table but only if
  3521.      pthread_detach() was called and there are no waiting joins.
  3522.     (pthread_create): Set detach flag in thread entry if the 
  3523.     thread is created PTHREAD_CREATE_DETACHED.
  3524.  
  3525.     * pthread.h (pthread_attr_t): Rename member "detachedstate".
  3526.  
  3527.     * attr.c (pthread_attr_init): Rename attr members.
  3528.  
  3529.     * exit.c (pthread_exit): Fix indirection mistake.
  3530.  
  3531.     * implement.h (PTW32_THREADS_TABLE_INDEX): Add.
  3532.  
  3533.     * exit.c (ptw32_vacuum): Fix incorrect args to
  3534.     ptw32_handler_pop_all() calls.
  3535.     Make thread entry removal conditional.
  3536.  
  3537.     * sync.c (pthread_join): Add multiple join and async detach handling.
  3538.  
  3539.     * implement.h (PTW32_THREADS_TABLE_INDEX): Add.
  3540.  
  3541.     * global.c (ptw32_threads_mutex_table): Add.
  3542.  
  3543.     * implement.h (ptw32_once_flag): Remove.
  3544.     (ptw32_once_lock): Ditto.
  3545.     (ptw32_threads_mutex_table): Add.
  3546.  
  3547.     * global.c (ptw32_once_flag): Remove.
  3548.     (ptw32_once_lock): Ditto.
  3549.  
  3550.     * sync.c (pthread_join): Fix tests involving new return value
  3551.     from ptw32_find_thread_entry().
  3552.     (pthread_detach): Ditto.
  3553.  
  3554.     * private.c (ptw32_find_thread_entry): Failure return code
  3555.     changed from -1 to NULL.
  3556.  
  3557. Fri Jul 24 23:09:33 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3558.  
  3559.     * create.c (pthread_create): Change . to -> in sigmask memcpy() args.
  3560.  
  3561.     * pthread.h: (pthread_cancel): Add function prototype.
  3562.     (pthread_testcancel): Ditto.
  3563.  
  3564. 1998-07-24  Ben Elliston  <bje@cygnus.com>
  3565.  
  3566.     * pthread.h (pthread_condattr_t): Rename dummy structure member.
  3567.     (pthread_mutexattr_t): Likewise.
  3568.  
  3569. Fri Jul 24 21:13:55 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3570.  
  3571.     * cancel.c (pthread_cancel): Implement.
  3572.     (pthread_testcancel): Implement.
  3573.  
  3574.     * exit.c (pthread_exit): Add comment explaining the longjmp().
  3575.  
  3576.     * implement.h (ptw32_threads_thread_t): New member cancelthread.
  3577.     (PTW32_YES): Define.
  3578.     (PTW32_NO): Define.
  3579.     (RND_SIZEOF): Remove.
  3580.  
  3581.     * create.c (pthread_create): Rename cancelability to cancelstate.
  3582.  
  3583.     * pthread.h (pthread_attr_t): Rename cancelability to cancelstate.
  3584.     (PTHREAD_CANCELED): Define.
  3585.  
  3586. 1998-07-24  Ben Elliston  <bje@cygnus.com>
  3587.  
  3588.     * pthread.h (SIG_BLOCK): Define if not already defined.
  3589.     (SIG_UNBLOCK): Likewise.
  3590.     (SIG_SETMASK): Likewise.
  3591.     (pthread_attr_t): Add signal mask member.
  3592.     (pthread_sigmask): Add function prototype.
  3593.  
  3594.     * signal.c (pthread_sigmask): Implement.
  3595.  
  3596.     * create.c: #include <string.h> to get a prototype for memcpy().
  3597.     (pthread_create): New threads inherit their creator's signal
  3598.     mask.  Copy the signal mask to the new thread structure if we know
  3599.     about signals.
  3600.     
  3601. Fri Jul 24 16:33:17 1998  Ross Johnson  <rpj@swan.canberra.edu.au>
  3602.  
  3603.     * fork.c (pthread_atfork): Add all the necessary push calls.
  3604.     Local implementation semantics:
  3605.     If we get an ENOMEM at any time then ALL handlers
  3606.     (including those from previous pthread_atfork() calls) will be
  3607.     popped off each of the three atfork stacks before we return.
  3608.     (fork): Add all the necessary pop calls. Add the thread cancellation
  3609.     and join calls to the child fork.
  3610.     Add #includes.
  3611.  
  3612.     * implement.h: (ptw32_handler_push): Fix return type and stack arg
  3613.     type in prototype.
  3614.     (ptw32_handler_pop): Fix stack arg type in prototype.
  3615.     (ptw32_handler_pop_all): Fix stack arg type in prototype.
  3616.  
  3617.     * cleanup.c (ptw32_handler_push): Change return type to int and
  3618.     return ENOMEM if malloc() fails.
  3619.  
  3620.     * sync.c (pthread_detach): Use equality test, not assignment.
  3621.  
  3622.     * create.c (ptw32_start_call): Add call to Win32 CloseHandle()
  3623.     if thread is detached.
  3624.  
  3625. 1998-07-24  Ben Elliston  <bje@cygnus.com>
  3626.  
  3627.     * sync.c (pthread_detach): Close the Win32 thread handle to
  3628.     emulate detached (or daemon) threads.
  3629.  
  3630. Fri Jul 24 03:00:25 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3631.  
  3632.     * sync.c (pthread_join): Save valueptr arg in joinvalueptr for
  3633.     pthread_exit() to use.
  3634.  
  3635.     * private.c (ptw32_new_thread_entry): Initialise joinvalueptr to
  3636.     NULL.
  3637.  
  3638.     * create.c (ptw32_start_call): Rewrite to facilitate joins.
  3639.     pthread_exit() will do a longjmp() back to here. Does appropriate
  3640.     cleanup and exit/return from the thread.
  3641.     (pthread_create): _beginthreadex() now passes a pointer to our
  3642.     thread table entry instead of just the call member of that entry.
  3643.  
  3644.     * implement.h (ptw32_threads_thread): New member 
  3645.     void ** joinvalueptr.
  3646.     (ptw32_call_t): New member jmpbuf env.
  3647.  
  3648.     * exit.c (pthread_exit): Major rewrite to handle joins and handing
  3649.     value pointer to joining thread. Uses longjmp() back to 
  3650.     ptw32_start_call().
  3651.  
  3652.     * create.c (pthread_create): Ensure values of new attribute members
  3653.     are copied to the thread attribute object.
  3654.  
  3655.     * attr.c (pthread_attr_destroy):  Fix merge conflicts.
  3656.     (pthread_attr_getdetachstate):  Fix merge conflicts.
  3657.     (pthread_attr_setdetachstate):  Fix merge conflicts.
  3658.  
  3659.     * pthread.h:  Fix merge conflicts.
  3660.  
  3661.     * sync.c (pthread_join): Fix merge conflicts.
  3662.  
  3663. Fri Jul 24 00:21:21 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3664.  
  3665.     * sync.c (pthread_join): Add check for valid and joinable
  3666.     thread.
  3667.     (pthread_detach): Implement. After checking for a valid and joinable
  3668.     thread, it's still a no-op.
  3669.  
  3670.     * private.c (ptw32_find_thread_entry): Bug prevented returning
  3671.     an error value in some cases.
  3672.  
  3673.     * attr.c (pthread_attr_setdetachedstate): Implement.
  3674.     (pthread_attr_getdetachedstate): Implement.
  3675.  
  3676.     * implement.h: Move more hidden definitions into here from
  3677.     pthread.h.
  3678.  
  3679. 1998-07-24  Ben Elliston  <bje@cygnus.com>
  3680.  
  3681.     * pthread.h (PTHREAD_CREATE_JOINABLE): Define.
  3682.     (PTHREAD_CREATE_DETACHED): Likewise.
  3683.     (pthread_attr_t): Add new structure member `detached'.
  3684.     (pthread_attr_getdetachstate): Add function prototype.
  3685.     (pthread_attr_setdetachstate): Likewise.
  3686.  
  3687.     * sync.c (pthread_join): Return if the target thread is detached.
  3688.  
  3689.     * attr.c (pthread_attr_init): Initialise cancelability and
  3690.     canceltype structure members.
  3691.     (pthread_attr_getdetachstate): Implement.
  3692.     (pthread_attr_setdetachstate): Likewise.
  3693.  
  3694.     * implement.h (PTW32_CANCEL_DEFAULTS): Remove.  Bit fields
  3695.     proved to be too cumbersome.  Set the defaults in attr.c using the
  3696.     public PTHREAD_CANCEL_* constants.
  3697.  
  3698.     * cancel.c: New file.
  3699.  
  3700.     * pthread.h (sched_param): Define this type.
  3701.     (pthread_attr_getschedparam): Add function prototype.
  3702.     (pthread_attr_setschedparam): Likewise.
  3703.     (pthread_setcancelstate): Likewise.
  3704.     (pthread_setcanceltype): Likewise.
  3705.     (sched_get_priority_min): Likewise.
  3706.     (sched_get_priority_max): Likewise.
  3707.     (pthread_mutexattr_setprotocol): Remove; not supported.
  3708.     (pthread_mutexattr_getprotocol): Likewise.
  3709.     (pthread_mutexattr_setprioceiling): Likewise.
  3710.     (pthread_mutexattr_getprioceiling): Likewise.
  3711.     (pthread_attr_t): Add canceltype member.  Update comments.
  3712.     (SCHED_OTHER): Define this scheduling policy constant.
  3713.     (SCHED_FIFO): Likewise.
  3714.     (SCHED_RR): Likewise.
  3715.     (SCHED_MIN): Define the lowest possible value for this constant.
  3716.     (SCHED_MAX): Likewise, the maximum possible value.
  3717.     (PTHREAD_CANCEL_ASYNCHRONOUS): Redefine.
  3718.     (PTHREAD_CANCEL_DEFERRED): Likewise.
  3719.     
  3720.     * sched.c: New file.
  3721.     (pthread_setschedparam): Implement.
  3722.     (pthread_getschedparam): Implement.
  3723.     (sched_get_priority_max): Validate policy argument.
  3724.     (sched_get_priority_min): Likewise.
  3725.  
  3726.     * mutex.c (pthread_mutexattr_setprotocol): Remove; not supported.
  3727.     (pthread_mutexattr_getprotocol): Likewise.
  3728.     (pthread_mutexattr_setprioceiling): Likewise.
  3729.     (pthread_mutexattr_getprioceiling): Likewise.
  3730.  
  3731. Fri Jul 24 00:21:21 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3732.  
  3733.     * create.c (pthread_create): Arg to ptw32_new_thread_entry()
  3734.     changed. See next entry. Move mutex locks out. Changes made yesterday
  3735.     and today allow us to start the new thread running rather than
  3736.     temporarily suspended.
  3737.  
  3738.     * private.c (ptw32_new_thread_entry): ptw32_thread_table
  3739.     was changed back to a table of thread structures rather than pointers.
  3740.     As such we're trading storage for increaded speed. This routine
  3741.     was modified to work with the new table. Mutex lock put in around
  3742.     global data accesses.
  3743.     (ptw32_find_thread_entry): Ditto
  3744.     (ptw32_delete_thread_entry): Ditto
  3745.  
  3746. Thu Jul 23 23:25:30 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3747.  
  3748.     * global.c: New. Global data objects declared here. These moved from
  3749.     pthread.h.
  3750.  
  3751.     * pthread.h: Move implementation hidden definitions into
  3752.     implement.h.
  3753.  
  3754.     * implement.h: Move implementation hidden definitions from
  3755.     pthread.h. Add constants to index into the different handler stacks.
  3756.  
  3757.     * cleanup.c (ptw32_handler_push): Simplify args. Restructure.
  3758.     (ptw32_handler_pop): Simplify args. Restructure.
  3759.     (ptw32_handler_pop_all): Simplify args. Restructure.
  3760.  
  3761. Wed Jul 22 00:16:22 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3762.  
  3763.     * attr.c, implement.h, pthread.h, ChangeLog: Resolve CVS merge
  3764.     conflicts.
  3765.  
  3766.     * private.c (ptw32_find_thread_entry): Changes to return type
  3767.     to support leaner ptw32_threads_table[] which now only stores
  3768.     ptw32_thread_thread_t *.
  3769.     (ptw32_new_thread_entry): Internal changes.
  3770.     (ptw32_delete_thread_entry): Internal changes to avoid contention.
  3771.      Calling routines changed accordingly.
  3772.  
  3773.     * pthread.h: Modified cleanup macros to use new generic push and pop.
  3774.     Added destructor and atfork stacks to ptw32_threads_thread_t.
  3775.  
  3776.     * cleanup.c (ptw32_handler_push, ptw32_handler_pop,
  3777.     ptw32_handler_pop_all): Renamed cleanup push and pop routines
  3778.     and made generic to handle destructors and atfork handlers as
  3779.     well.
  3780.  
  3781.     * create.c (ptw32_start_call): New function is a wrapper for
  3782.     all new threads. It allows us to do some cleanup when the thread
  3783.     returns, ie. that is otherwise only done if the thread is cancelled.
  3784.  
  3785.     * exit.c (ptw32_vacuum): New function contains code from 
  3786.     pthread_exit() that we need in the new ptw32_start_call()
  3787.     as well.
  3788.  
  3789.     * implement.h: Various additions and minor changes.
  3790.  
  3791.     * pthread.h: Various additions and minor changes.
  3792.     Change cleanup handler macros to use generic handler push and pop
  3793.     functions.
  3794.  
  3795.     * attr.c: Minor mods to all functions.
  3796.     (is_attr): Implemented missing function.
  3797.  
  3798.     * create.c (pthread_create): More clean up.
  3799.  
  3800.     * private.c (ptw32_find_thread_entry): Implement.
  3801.     (ptw32_delete_thread_entry): Implement.
  3802.     (ptw32_new_thread_entry): Implement.
  3803.     These functions manipulate the implementations internal thread
  3804.     table and are part of general code cleanup and modularisation.
  3805.     They replace ptw32_getthreadindex() which was removed.
  3806.  
  3807.     * exit.c (pthread_exit): Changed to use the new code above.
  3808.  
  3809.     * pthread.h: Add cancelability constants. Update comments.
  3810.  
  3811. 1998-07-22  Ben Elliston  <bje@cygnus.com>
  3812.  
  3813.     * attr.c (pthread_setstacksize): Update test of attr argument.
  3814.     (pthread_getstacksize): Likewise.
  3815.     (pthread_setstackaddr): Likewise.
  3816.     (pthread_getstackaddr): Likewise.
  3817.     (pthread_attr_init): No need to allocate any storage.
  3818.     (pthread_attr_destroy): No need to free any storage.
  3819.  
  3820.     * mutex.c (is_attr): Not likely to be needed; remove.
  3821.     (remove_attr): Likewise.
  3822.     (insert_attr): Likewise.
  3823.  
  3824.     * implement.h (ptw32_mutexattr_t): Moved to a public definition
  3825.     in pthread.h.  There was little gain in hiding these details.
  3826.     (ptw32_condattr_t): Likewise.
  3827.     (ptw32_attr_t): Likewise.
  3828.  
  3829.     * pthread.h (pthread_atfork): Add function prototype.
  3830.     (pthread_attr_t): Moved here from implement.h.
  3831.  
  3832.     * fork.c (pthread_atfork): Preliminary implementation.
  3833.     (ptw32_fork): Likewise.
  3834.  
  3835. Wed Jul 22 00:16:22 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3836.  
  3837.     * cleanup.c (ptw32_cleanup_push): Implement.
  3838.     (ptw32_cleanup_pop): Implement.
  3839.     (ptw32_do_cancellation): Implement.
  3840.     These are private to the implementation. The real cleanup functions
  3841.     are macros. See below.
  3842.  
  3843.     * pthread.h (pthread_cleanup_push): Implement as a macro.
  3844.     (pthread_cleanup_pop): Implement as a macro.
  3845.     Because these are macros which start and end a block, the POSIX scoping
  3846.     requirement is observed. See the comment in the file.
  3847.  
  3848.     * exit.c (pthread_exit): Refine the code.
  3849.  
  3850.     * create.c (pthread_create): Code cleanup.
  3851.  
  3852.     * implement.h (RND_SIZEOF): Add RND_SIZEOF(T) to round sizeof(T)
  3853.     up to multiple of DWORD.
  3854.     Add function prototypes.
  3855.  
  3856.     * private.c (ptw32_getthreadindex): "*thread" should have been 
  3857.     "thread". Detect empty slot fail condition.
  3858.  
  3859. 1998-07-20  Ben Elliston  <bje@cygnus.com>
  3860.  
  3861.     * misc.c (pthread_once): Implement.  Don't use a per-application
  3862.     flag and mutex--make `pthread_once_t' contain these elements in
  3863.     their structure.  The earlier version had incorrect semantics.
  3864.     
  3865.     * pthread.h (ptw32_once_flag): Add new variable.  Remove.
  3866.     (ptw32_once_lock): Add new mutex lock to ensure integrity of
  3867.     access to ptw32_once_flag.  Remove.
  3868.     (pthread_once): Add function prototype.
  3869.     (pthread_once_t): Define this type.
  3870.     
  3871. Mon Jul 20 02:31:05 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3872.  
  3873.     * private.c (ptw32_getthreadindex): Implement.
  3874.  
  3875.     * pthread.h: Add application static data dependent on
  3876.     _PTHREADS_BUILD_DLL define. This is needed to avoid allocating
  3877.     non-sharable static data within the pthread DLL.
  3878.  
  3879.     * implement.h: Add ptw32_cleanup_stack_t, ptw32_cleanup_node_t
  3880.     and PTW32_HASH_INDEX.
  3881.  
  3882.     * exit.c (pthread_exit): Begin work on cleanup and de-allocate
  3883.     thread-private storage.
  3884.  
  3885.     * create.c (pthread_create): Add thread to thread table.
  3886.     Keep a thread-private copy of the attributes with default values
  3887.     filled in when necessary. Same for the cleanup stack. Make 
  3888.     pthread_create C run-time library friendly by using _beginthreadex()
  3889.     instead of CreateThread(). Fix error returns.
  3890.  
  3891. Sun Jul 19 16:26:23 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3892.  
  3893.     * implement.h: Rename pthreads_thread_count to ptw32_threads_count.
  3894.     Create ptw32_threads_thread_t struct to keep thread specific data.
  3895.  
  3896.     * create.c: Rename pthreads_thread_count to ptw32_threads_count.
  3897.     (pthread_create): Handle errors from CreateThread().
  3898.  
  3899. 1998-07-19  Ben Elliston  <bje@cygnus.com>
  3900.  
  3901.     * condvar.c (pthread_cond_wait): Generalise.  Moved from here ..
  3902.     (cond_wait): To here.
  3903.     (pthread_cond_timedwait): Implement; use generalised cond_wait().
  3904.  
  3905.     * pthread.h (pthread_key_t): Define this type.
  3906.     (pthread_key_create): Add function prototype.
  3907.     (pthread_setspecific): Likewise.
  3908.     (pthread_getspecific): Likwise.
  3909.     (pthread_key_delete): Likewise.
  3910.  
  3911.     * tsd.c (pthread_key_create): Implement.
  3912.     (pthread_setspecific): Likewise.
  3913.     (pthread_getspecific): Likewise.
  3914.     (pthread_key_delete): Likewise.
  3915.  
  3916.     * mutex.c (pthread_mutex_trylock): Return ENOSYS if this function
  3917.     is called on a Win32 platform which is not Windows NT.
  3918.  
  3919. 1998-07-18  Ben Elliston  <bje@cygnus.com>
  3920.  
  3921.     * condvar.c (pthread_condattr_init): Do not attempt to malloc any
  3922.     storage; none is needed now that condattr_t is an empty struct.
  3923.     (pthread_condattr_destory): Likewise; do not free storage.
  3924.     (pthread_condattr_setpshared): No longer supported; return ENOSYS.
  3925.     (pthread_condattr_getpshared): Likewise.
  3926.     (pthread_cond_init): Implement with help from Douglas Schmidt.
  3927.     Remember to initialise the cv's internal mutex.
  3928.     (pthread_cond_wait): Likewise.
  3929.     (pthread_cond_signal): Likewise.
  3930.     (pthread_cond_broadcast): Likewise.
  3931.     (pthread_cond_timedwait): Preliminary implementation, but I need
  3932.     to see some API documentation for `WaitForMultipleObject'.
  3933.     (pthread_destory): Implement.
  3934.  
  3935.     * pthread.h (pthread_cond_init): Add function protoype.
  3936.     (pthread_cond_broadcast): Likewise.
  3937.     (pthread_cond_signal): Likewise.
  3938.     (pthread_cond_timedwait): Likewise.
  3939.     (pthread_cond_wait): Likewise.
  3940.     (pthread_cond_destroy): Likewise.
  3941.     (pthread_cond_t): Define this type.  Fix for u_int.  Do not assume
  3942.     that the mutex contained withing the pthread_cond_t structure will
  3943.     be a critical section.  Use our new POSIX type!
  3944.  
  3945.     * implement.h (ptw32_condattr_t): Remove shared attribute.
  3946.  
  3947. 1998-07-17  Ben Elliston  <bje@cygnus.com>
  3948.  
  3949.     * pthread.h (PTHREADS_PROCESS_PRIVATE): Remove.
  3950.     (PTHREAD_PROCESS_SHARED): Likewise.  No support for mutexes shared
  3951.     across processes for now.
  3952.     (pthread_mutex_t): Use a Win32 CRITICAL_SECTION type for better
  3953.     performance.
  3954.     
  3955.     * implement.h (ptw32_mutexattr_t): Remove shared attribute.
  3956.     
  3957.     * mutex.c (pthread_mutexattr_setpshared): This optional function
  3958.     is no longer supported, since we want to implement POSIX mutex
  3959.     variables using the much more efficient Win32 critical section
  3960.     primitives.  Critical section objects in Win32 cannot be shared
  3961.     between processes.
  3962.     (pthread_mutexattr_getpshared): Likewise.
  3963.     (pthread_mutexattr_init): No need to malloc any storage; the
  3964.     attributes structure is now empty.
  3965.     (pthread_mutexattr_destroy): This is now a nop.
  3966.     (pthread_mutex_init): Use InitializeCriticalSection().
  3967.     (pthread_mutex_destroy): Use DeleteCriticalSection().
  3968.     (pthread_mutex_lock): Use EnterCriticalSection().
  3969.     (pthread_mutex_trylock): Use TryEnterCriticalSection().  This is
  3970.     not supported by Windows 9x, but trylock is a hack anyway, IMHO.
  3971.     (pthread_mutex_unlock): Use LeaveCriticalSection().
  3972.  
  3973. 1998-07-14  Ben Elliston  <bje@cygnus.com>
  3974.  
  3975.     * attr.c (pthread_attr_setstacksize): Implement.
  3976.     (pthread_attr_getstacksize): Likewise.
  3977.     (pthread_attr_setstackaddr): Likewise.
  3978.     (pthread_attr_getstackaddr): Likewise.
  3979.     (pthread_attr_init): Likewise.
  3980.     (pthread_attr_destroy): Likewise.
  3981.     
  3982.     * condvar.c (pthread_condattr_init): Add `_cond' to function name.
  3983.  
  3984.     * mutex.c (pthread_mutex_lock): Add `_mutex' to function name.
  3985.     (pthread_mutex_trylock): Likewise.
  3986.     (pthread_mutex_unlock): Likewise.
  3987.  
  3988.     * pthread.h (pthread_condattr_setpshared): Fix typo.
  3989.     (pthread_attr_init): Add function prototype.
  3990.     (pthread_attr_destroy): Likewise.
  3991.     (pthread_attr_setstacksize): Likewise.
  3992.     (pthread_attr_getstacksize): Likewise.
  3993.     (pthread_attr_setstackaddr): Likewise.
  3994.     (pthread_attr_getstackaddr): Likewise.
  3995.     
  3996. Mon Jul 13 01:09:55 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  3997.  
  3998.     * implement.h: Wrap in #ifndef _IMPLEMENT_H
  3999.  
  4000.     * create.c (pthread_create): Map stacksize attr to Win32.
  4001.  
  4002.     * mutex.c: Include implement.h
  4003.  
  4004. 1998-07-13  Ben Elliston  <bje@cygnus.com>
  4005.  
  4006.     * condvar.c (pthread_condattr_init): Implement.
  4007.     (pthread_condattr_destroy): Likewise.
  4008.     (pthread_condattr_setpshared): Likewise.
  4009.     (pthread_condattr_getpshared): Likewise.
  4010.     
  4011.     * implement.h (PTHREAD_THREADS_MAX): Remove trailing semicolon.
  4012.     (PTHREAD_STACK_MIN): Specify; needs confirming.
  4013.     (ptw32_attr_t): Define this type.
  4014.     (ptw32_condattr_t): Likewise.
  4015.  
  4016.     * pthread.h (pthread_mutex_t): Define this type.
  4017.     (pthread_condattr_t): Likewise.
  4018.     (pthread_mutex_destroy): Add function prototype.
  4019.     (pthread_lock): Likewise.
  4020.     (pthread_trylock): Likewise.
  4021.     (pthread_unlock): Likewise.
  4022.     (pthread_condattr_init): Likewise.
  4023.     (pthread_condattr_destroy): Likewise.
  4024.     (pthread_condattr_setpshared): Likewise.
  4025.     (pthread_condattr_getpshared): Likewise.
  4026.  
  4027.     * mutex.c (pthread_mutex_init): Implement.
  4028.     (pthread_mutex_destroy): Likewise.
  4029.     (pthread_lock): Likewise.
  4030.     (pthread_trylock): Likewise.
  4031.     (pthread_unlock): Likewise.
  4032.  
  4033. 1998-07-12  Ben Elliston  <bje@cygnus.com>
  4034.  
  4035.     * implement.h (ptw32_mutexattr_t): Define this implementation
  4036.     internal type.  Application programmers only see a mutex attribute
  4037.     object as a void pointer.
  4038.  
  4039.     * pthread.h (pthread_mutexattr_t): Define this type.
  4040.     (pthread_mutexattr_init): Add function prototype.
  4041.     (pthread_mutexattr_destroy): Likewise.
  4042.     (pthread_mutexattr_setpshared): Likewise.
  4043.     (pthread_mutexattr_getpshared): Likewise.
  4044.     (pthread_mutexattr_setprotocol): Likewise.
  4045.     (pthread_mutexattr_getprotocol): Likewise.
  4046.     (pthread_mutexattr_setprioceiling): Likewise.
  4047.     (pthread_mutexattr_getprioceiling): Likewise.
  4048.     (PTHREAD_PROCESS_PRIVATE): Define.
  4049.     (PTHREAD_PROCESS_SHARED): Define.
  4050.  
  4051.     * mutex.c (pthread_mutexattr_init): Implement.
  4052.     (pthread_mutexattr_destroy): Implement.
  4053.     (pthread_mutexattr_setprotocol): Implement.
  4054.     (pthread_mutexattr_getprotocol): Likewise.
  4055.     (pthread_mutexattr_setprioceiling): Likewise.
  4056.     (pthread_mutexattr_getprioceiling): Likewise.
  4057.     (pthread_mutexattr_setpshared): Likewise.
  4058.     (pthread_mutexattr_getpshared): Likewise.
  4059.     (insert_attr): New function; very preliminary implementation!
  4060.     (is_attr): Likewise.
  4061.     (remove_attr): Likewise.
  4062.     
  4063. Sat Jul 11 14:48:54 1998  Ross Johnson  <rpj@ixobrychus.canberra.edu.au>
  4064.  
  4065.     * implement.h: Preliminary implementation specific defines.
  4066.  
  4067.     * create.c (pthread_create): Preliminary implementation.
  4068.  
  4069. 1998-07-11  Ben Elliston  <bje@cygnus.com>
  4070.  
  4071.     * sync.c (pthread_join): Implement.
  4072.  
  4073.     * misc.c (pthread_equal): Likewise.
  4074.     
  4075.     * pthread.h (pthread_join): Add function prototype.
  4076.     (pthread_equal): Likewise.
  4077.     
  4078. 1998-07-10  Ben Elliston  <bje@cygnus.com>
  4079.  
  4080.     * misc.c (pthread_self): Implement.
  4081.  
  4082.     * exit.c (pthread_exit): Implement.
  4083.  
  4084.     * pthread.h (pthread_exit): Add function prototype.
  4085.     (pthread_self): Likewise.
  4086.     (pthread_t): Define this type.
  4087.  
  4088. 1998-07-09  Ben Elliston  <bje@cygnus.com>
  4089.  
  4090.     * create.c (pthread_create): A dummy stub right now.
  4091.  
  4092.     * pthread.h (pthread_create): Add function prototype.
  4093.