From c94735ecdde19c4de652efd144faeec1a729b1e0 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 28 Dec 2000 05:32:07 +0000 Subject: ./ChangeLog: 2000-12-28 Ross Johnson * private.c (ptw32_threadStart): Unhandled exceptions are now passed through to the system to deal with. This is consistent with normal Windows behaviour. C++ applications may use set_terminate() to override the default behaviour which is to call ptw32_terminate(). Ptw32_terminate() cleans up some POSIX thread stuff before calling the system default function which calls abort(). The users termination function should conform to standard C++ semantics which is to not return. It should exit the thread (call pthread_exit()) or exit the application. * private.c (ptw32_terminate): Added as the default set_terminate() function. It calls the system default function after cleaning up some POSIX thread stuff. * implement.h (ptw32_try_enter_critical_section): Move declaration. * global.c (ptw32_try_enter_critical_section): Moved from dll.c. * dll.c: Move process and thread attach/detach code into functions in nonportable.c. * nonportable.c (pthread_win32_process_attach_np): Process attach code from dll.c is now available to static linked applications. * nonportable.c (pthread_win32_process_detach_np): Likewise. * nonportable.c (pthread_win32_thread_attach_np): Likewise. * nonportable.c (pthread_win32_thread_detach_np): Likewise. * pthread.h: Add new non-portable prototypes for static linked applications. * GNUmakefile (OPT): Increase optimisation flag and remove debug info flag. * pthread.def: Add new non-portable exports for static linked applications. 2000-12-11 Ross Johnson * FAQ: Update Answer 6 re getting a fully working Mingw32 built library. 2000-09-09 Ross Johnson * pthread.h (ctime_r): Fix arg. ./tests/ChangeLog: 2000-12-28 Ross Johnson * eyal1.c: Increase thread work loads. * exception2.c: New test. * exception3.c: New test. * Makefile: Add new tests exception2.c and exception3.c. * GNUmakefile: Likewise. 2000-12-11 Ross Johnson * cleanup3.c: Remove unused variable. * cleanup2.c: Likewise. * exception1.c: Throw an exception rather than use a deliberate zero divide so that catch(...) will handle it under Mingw32. Mingw32 now builds the library correctly to pass all tests - see Thomas Pfaff's detailed instructions re needed changes to Mingw32 in the Pthreads-Win32 FAQ. --- README | 56 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 22 deletions(-) (limited to 'README') diff --git a/README b/README index 25792ca..93bf8cd 100644 --- a/README +++ b/README @@ -71,17 +71,6 @@ Known bugs in this snapshot 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(). - -3. There are problems using the libpthreadw32.a stub archive derived -from either of pthreadVSE.dll or pthreadVCE.dll. The cleanup1.c test -fails. This is now an expected result of having different EH and cleanup -handler schemes in the library and application. - Caveats ------- @@ -143,6 +132,34 @@ pthread_getw32threadhandle_np(pthread_t thread); Applications can use the win32 handle to set win32 specific attributes of the thread. +int +pthread_delay_np (const struct timespec *interval); + + This routine causes a thread to delay execution for a specific period of time. + This period ends at the current time plus the specified interval. The routine + will not return before the end of the period is reached, but may return an + arbitrary amount of time after the period has gone by. This can be due to + system load, thread priorities, and system timer granularity. + + Specifying an interval of zero (0) seconds and zero (0) nanoseconds is + allowed and can be used to force the thread to give up the processor or to + deliver a pending cancelation request. + + This routine is a cancelation point. + + The timespec structure contains the following two fields: + + tv_sec is an integer number of seconds. + tv_nsec is an integer number of nanoseconds. + + Return Values + + If an error condition occurs, this routine returns an integer value + indicating the type of error. Possible return values are as follows: + + 0 Successful completion. + [EINVAL] The value specified by interval is invalid. + int pthreadCancelableWait (HANDLE waitHandle); @@ -156,7 +173,7 @@ pthreadCancelableTimedWait (HANDLE waitHandle, DWORD timeout); pthread_cancel has been called. It is implemented using WaitForMultipleObjects on 'waitHandle' and a manually reset w32 event used to implement pthread_cancel. - + Building under VC++ using either C++ EH or Structured EH -------------------------------------------------------- @@ -182,20 +199,15 @@ nmake clean VSE Building under Mingw32 ---------------------- -The dll can be built with Mingw32 gcc-2.95.2 or later. +The dll can be built with Mingw32 gcc-2.95.2-1 after you've +made the changes to Mingw32 desribed in Question 6 of the FAQ. +Hopefully versions after gcc-2.95.2-1 won't require the fix. + Run "make" in the source directory (uses GNUmakefile). This builds pthreadGCE.dll and libpthreadw32.a. -To generate the libpthreadw32.a file from pthreadVCE.dll rather than -building the library with G++, run "make fake.a". (You must have -pthreadVCE.dll already built - see above.) -Please note that VC++ and GNU exception handling is implemented -completely differently and so automatic cleanup of objects and -the propagation of exceptions themselves between the two schemes is not -going to happen. - You can run the testsuite by changing to the "tests" directory and -running "make clean" and then "make". See the "Known bugs" section above. +running "make clean" and then "make". Building the library under Cygwin -- cgit v1.2.3