From 11eb4dfd2d42417327fc205c649ea32ee623cf92 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 18 Aug 2000 08:02:29 +0000 Subject: 2000-08-18 Ross Johnson * Several: Fix typos from scripted edit session yesterday. * nonportable.c (pthread_mutexattr_setforcecs_np): Moved this function from mutex.c. (pthread_getw32threadhandle_np): New function to return the win32 thread handle that the POSIX thread is using. * mutex.c (pthread_mutexattr_setforcecs_np): Moved to new file "nonportable.c". * pthread.h (PTW32_BUILD): Only redefine __except and catch compiler keywords if we aren't building the library (ie. PTW32_BUILD is not defined) - this is safer than defining and then undefining if not building the library. * implement.h: Remove __except and catch undefines. * Makefile (CFLAGS): Define PTW32_BUILD. * GNUmakefile (CFLAGS): Define PTW32_BUILD. * All appropriate: Change Pthread_exception* to ptw32_exception* to be consistent with internal identifier naming. * private.c (ptw32_throw): New function to provide a generic exception throw for all internal exceptions and EH schemes. (ptw32_threadStart): pthread_exit() value is now returned via the thread structure exitStatus element. * exit.c (pthread_exit): pthread_exit() value is now returned via the thread structure exitStatus element. * cancel.c (ptw32_cancel_self): Now uses ptw32_throw. (pthread_setcancelstate): Ditto. (pthread_setcanceltype): Ditto. (pthread_testcancel): Ditto. (pthread_cancel): Ditto. * misc.c (CancelableWait): Ditto. * exit.c (pthread_exit): Ditto. * All applicable: Change PTW32_ prefix to PTW32_ prefix to remove leading underscores from private library identifiers. --- README | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'README') diff --git a/README b/README index 794ba7d..3ad70f9 100644 --- a/README +++ b/README @@ -52,15 +52,18 @@ The GNU library archive file name has changed to: Known bugs in this snapshot --------------------------- -1. Running the test "join1.c" with the library built with Mingw32 +1. Asynchronous cancelation only works on Intel X86 machines. + +2. Running the test "join1.c" with the library built with Mingw32 and the GNUmakefile included, the test fails with a segmentation (invalid page access) exception. The fault appears to be in the assembler code emmitted by the compiler [to handle exception contexts] at the end of the try block in ptw32_threadStart(). -2. There are problems using the libpthreadw32.a stub archive derived +3. There are problems using the libpthreadw32.a stub archive derived from either of pthreadVSE.dll or pthreadVCE.dll. The cleanup1.c test -fails. +fails. This is now an expected result of having different EH and cleanup +handler schemes in the library and application. Caveats @@ -85,6 +88,39 @@ Otherwise neither pthreads cancelation nor pthread_exit() will work reliably. +Non-portable functions included in the library +---------------------------------------------- + +void +pthread_mutexattr_setforcecs_np(pthread_mutexattr_t *attr, + int forcecs); + + Allows an application to force the library to use + critical sections rather than win32 mutexes as + the basis for any mutex that uses "attr". + Critical sections are significantly faster than + mutexes. + + Values for "forcecs" are: + PTHREAD_MUTEX_AUTO_CS_NP + - allow the library to decide based on + availability of tryEnterCriticalSection() + PTHREAD_MUTEX_FORCE_CS_NP + - force use of critical sections, but you'd + better not try to use pthread_mutex_trylock() + on that mutex if you want your application + to work on all versions of Windows. + +HANDLE +pthread_getw32threadhandle_np(pthread_t thread); + + Returns the win32 thread handle that the POSIX + thread "thread" is running as. + + Applications can use the win32 handle to set + win32 specific attributes of the thread. + + Building under VC++ using either C++ EH or Structured EH -------------------------------------------------------- -- cgit v1.2.3