📄 changelog
字号:
* pthread.c: Agregation of agregate modules for super-inlineability.2002-02-02 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * cancel.c: Rearranged some code and introduced checks to disable cancelation at the start of a thread's cancelation run to prevent double cancelation. The main problem arises if a thread is canceling and then receives a subsequent async cancel request. * private.c: Likewise. * condvar.c: Place pragmas around cleanup_push/pop to turn off inline optimisation (/Obn where n>0 - MSVC only). Various optimisation switches in MSVC turn this on, which interferes with the way that cleanup handlers are run in C++ EH and SEH code. Application code compiled with inline optimisation must also wrap cleanup_push/pop blocks with the pragmas, e.g. #pragma inline_depth(0) pthread_cleanup_push(...) ... pthread_cleanup_pop(...) #pragma inline_depth(8) * rwlock.c: Likewise. * mutex.c: Remove attempts to inline some functions. * signal.c: Modify misleading comment.2002-02-01 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * semaphore.c (sem_trywait): Fix missing errno return for systems that define NEED_SEM (e.g. early WinCE). * mutex.c (pthread_mutex_timedlock): Return ENOTSUP for systems that define NEED_SEM since they don't have sem_trywait().2002-01-27 Ross Johnson <rpj at special.ise.canberra.edu.au> * mutex.c (pthread_mutex_timedlock): New function suggested by Alexander Terekhov. The logic required to implement this properly came from Alexander, with some collaboration with Thomas Pfaff. (pthread_mutex_unlock): Wrap the waiters check and sema post in a critical section to prevent a race with pthread_mutex_timedlock. (ptw32_timed_semwait): New function; returns a special result if the absolute timeout parameter represents a time already passed when called; used by pthread_mutex_timedwait(). Have deliberately not reused the name "ptw32_sem_timedwait" because they are not the same routine. * condvar.c (ptw32_cond_timedwait): Use the new sem_timedwait() instead of ptw32_sem_timedwait(), which now has a different function. See previous. * implement.h: Remove prototype for ptw32_sem_timedwait. See next. (pthread_mutex_t_): Add critical section element for access to lock_idx during mutex post-timeout processing. * semaphore.h (sem_timedwait): See next. * semaphore.c (sem_timedwait): See next. * private.c (ptw32_sem_timedwait): Move to semaphore.c and rename as sem_timedwait().2002-01-18 Ross Johnson <rpj at special.ise.canberra.edu.au> * sync.c (pthread_join): Was getting the exit code from the calling thread rather than the joined thread if defined(__MINGW32__) && !defined(__MSVCRT__).2002-01-15 Ross Johnson <rpj at special.ise.canberra.edu.au> * pthread.h: Unless the build explicitly defines __CLEANUP_SEH, __CLEANUP_CXX, or __CLEANUP_C, then the build defaults to __CLEANUP_C style cleanup. This style uses setjmp/longjmp in the cancelation and thread exit implementations and therefore won't do stack unwinding if linked to applications that have it (e.g. C++ apps). This is currently consistent with most/all commercial Unix POSIX threads implementations. * spin.c (pthread_spin_init): Edit renamed function call. * nonportable.c (pthread_num_processors_np): New. (pthread_getprocessors_np): Renamed to ptw32_getprocessors and moved to private.c. * private.c (pthread_getprocessors): Moved here from nonportable.c. * pthread.def (pthread_getprocessors_np): Removed from export list. * rwlock.c (pthread_rwlockattr_init): New. (pthread_rwlockattr_destroy): New. (pthread_rwlockattr_getpshared): New. (pthread_rwlockattr_setpshared): New.2002-01-14 Ross Johnson <rpj at special.ise.canberra.edu.au> * attr.c (pthread_attr_setscope): Fix struct pointer indirection error introduced 2002-01-04. (pthread_attr_getscope): Likewise.2002-01-12 Ross Johnson <rpj at special.ise.canberra.edu.au> * pthread.dsp (SOURCE): Add missing source files.2002-01-08 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * mutex.c (pthread_mutex_trylock): use ptw32_interlocked_compare_exchange function pointer rather than ptw32_InterlockedCompareExchange() directly to retain portability to non-iX86 processors, e.g. WinCE etc. The pointer will point to the native OS version of InterlockedCompareExchange() if the OS supports it (see ChangeLog entry of 2001-10-17).2002-01-07 Thomas Pfaff <tpfaff at gmx.net>, Alexander Terekhov <TEREKHOV at de.ibm.com> * mutex.c (pthread_mutex_init): Remove critical section calls. (pthread_mutex_destroy): Likewise. (pthread_mutex_unlock): Likewise. (pthread_mutex_trylock): Likewise; uses ptw32_InterlockedCompareExchange() to avoid need for critical section; library is no longer i386 compatible; recursive mutexes now increment the lock count rather than return EBUSY; errorcheck mutexes return EDEADLCK rather than EBUSY. This behaviour is consistent with the Solaris pthreads implementation. * implement.h (pthread_mutex_t_): Remove critical section element - no longer needed. 2002-01-04 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * attr.c (pthread_attr_setscope): Add more error checking and actually store the scope value even though it's not really necessary. (pthread_attr_getscope): Return stored value. * implement.h (pthread_attr_t_): Add new scope element. * ANNOUNCE: Fix out of date comment next to pthread_attr_setscope in conformance section.2001-12-21 Alexander Terekhov <TEREKHOV at de.ibm.com> * mutex.c (pthread_mutex_lock): Decrementing lock_idx was not thread-safe. (pthread_mutex_trylock): Likewise.2001-10-26 prionx@juno.com * semaphore.c (sem_init): Fix typo and missing bracket in conditionally compiled code. Only older versions of WinCE require this code, hence it doesn't normally get tested; somehow when sem_t reverted to an opaque struct the calloc NULL check was left in the conditionally included section. (sem_destroy): Likewise, the calloced sem_t wasn't being freed.2001-10-25 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * GNUmakefile (libwsock32): Add to linker flags for WSAGetLastError() and WSASetLastError(). * Makefile (wsock32.lib): Likewise. * create.c: Minor mostly inert changes. * implement.h (PTW32_MAX): Move into here and renamed from sched.h. (PTW32_MIN): Likewise. * GNUmakefile (TEST_ICE): Define if testing internal implementation of InterlockedCompareExchange. * Makefile (TEST_ICE): Likewise. * private.c (TEST_ICE): Likewise. 2001-10-24 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * attr.c (pthread_attr_setstacksize): Quell warning from LCC by conditionally compiling the stacksize validity check. LCC correctly warns that the condition (stacksize < PTHREAD_STACK_MIN) is suspicious because STACK_MIN is 0 and stacksize is of type size_t (or unsigned int).2001-10-17 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * barrier.c: Move _LONG and _LPLONG defines into implement.h; rename to PTW32_INTERLOCKED_LONG and PTW32_INTERLOCKED_LPLONG respectively. * spin.c: Likewise; ptw32_interlocked_compare_exchange used in place of InterlockedCompareExchange directly. * global.c (ptw32_interlocked_compare_exchange): Add prototype for this new routine pointer to be used when InterlockedCompareExchange isn't supported by Windows. * nonportable.c (pthread_win32_process_attach_np): Check for support of InterlockedCompareExchange in kernel32 and assign its address to ptw32_interlocked_compare_exchange if it exists, or our own ix86 specific implementation ptw32_InterlockedCompareExchange. *private.c (ptw32_InterlockedCompareExchange): An implementation of InterlockedCompareExchange() which is specific to ix86; written directly in assembler for either MSVC or GNU C; needed because Windows 95 doesn't support InterlockedCompareExchange(). * sched.c (sched_get_priority_min): Extend to return THREAD_PRIORITY_IDLE. (sched_get_priority_max): Extend to return THREAD_PRIORITY_CRITICAL.2001-10-15 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * spin.c (pthread_spin_lock): PTHREAD_SPINLOCK_INITIALIZER was causing a program fault. (pthread_spin_init): Could have alloced memory without freeing under some error conditions. * mutex.c (pthread_mutex_init): Move memory allocation of mutex struct after checking for PROCESS_SHARED.2001-10-12 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * spin.c (pthread_spin_unlock): Was not returning EPERM if the spinlock was not locked, for multi CPU machines.2001-10-08 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * spin.c (pthread_spin_trylock): Was not returning EBUSY for multi CPU machines.2001-08-24 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * condvar.c (pthread_cond_destroy): Remove cv element that is no longer used. * implement.h: Likewise.2001-08-23 Alexander Terekhov <TEREKHOV at de.ibm.com> * condvar.c (pthread_cond_destroy): fix bug with respect to deadlock in the case of concurrent _destroy/_unblock; a condition variable can be destroyed immediately after all the threads that are blocked on it are awakened.2001-08-23 Phil Frisbie, Jr. <phil at hawksoft.com> * tsd.c (pthread_getspecific): Preserve the last winsock error [from WSAGetLastError()].2001-07-18 Scott McCaskill <scott at magruder.org> * mutex.c (pthread_mutexattr_init): Return ENOMEM immediately and don't dereference the NULL pointer if calloc fails. (pthread_mutexattr_getpshared): Don't dereference a pointer that is possibly NULL. * barrier.c (pthread_barrierattr_init): Likewise (pthread_barrierattr_getpshared): Don't dereference a pointer that is possibly NULL. * condvar.c (pthread_condattr_getpshared): Don't dereference a pointer that is possibly NULL.2001-07-15 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * rwlock.c (pthread_rwlock_wrlock): Is allowed to be a cancelation point; re-enable deferred cancelability around the CV call.2001-07-10 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * barrier.c: Still more revamping. The exclusive access mutex isn't really needed so it has been removed and replaced by an InterlockedDecrement(). nSerial has been removed. iStep is now dual-purpose. The process shared attribute is now stored in the barrier struct. * implement.h (pthread_barrier_t_): Lost some/gained one elements. * private.c (ptw32_threadStart): Removed some comments.2001-07-10 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * barrier.c: Revamped to fix the race condition. Two alternating semaphores are used instead of the PulseEvent. Also improved overall throughput by returning PTHREAD_BARRIER_SERIAL_THREAD to the first waking thread. * implement.h (pthread_barrier_t_): Revamped.2001-07-09 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * barrier.c: Fix several bugs in all routines. Now passes tests/barrier5.c which is fairly rigorous. There is still a non-optimal work-around for a race condition between the barrier breeched event signal and event wait. Basically the last (signalling) thread to hit the barrier yields to allow any other threads, which may have lost the race, to complete.2001-07-07 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * barrier.c: Changed synchronisation mechanism to a Win32 manual reset Event and use PulseEvent to signal waiting threads. If the implementation continued to use a semaphore it would require a second semaphore and some management to use them alternately as barriers. A single semaphore allows threads to cascade from one barrier through the next, leaving some threads blocked at the first. * implement.h (pthread_barrier_t_): As per above. * general: Made a number of other routines inlinable.2001-07-07 Ross Johnson <rpj at setup1.ise.canberra.edu.au> * spin.c: Revamped and working; included static initialiser. Now beta level. * barrier.c: Likewise. * condvar.c: Macro constant change; inline auto init routine. * mutex.c: Likewise. * rwlock.c: Likewise. * private.c
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -