Index: ossp-pkg/pth/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/pth/ChangeLog,v rcsdiff -q -kk '-r1.566' '-r1.567' -u '/v/ossp/cvs/ossp-pkg/pth/ChangeLog,v' 2>/dev/null --- ChangeLog 2002/10/15 17:23:19 1.566 +++ ChangeLog 2002/10/15 18:17:28 1.567 @@ -21,6 +21,16 @@ Changes between 1.4.1 and 1.5.0 (27-Jan-2002 to xx-Sep-2002) + *) Fixed a long-standing termination bug in pth_exit(3): + The event handler of pth_exit(3) didn't let pth_exit(3) finish if + there were any threads on the "dead queue" (where non-detached + terminated threads are put). Instead it re-entered the scheduler + which in turn aborted with "**Pth** SCHEDULER INTERNAL ERROR: no + more thread(s) available to schedule!?!?". This is now fixed by + not counting the "dead queue" for the determination whether the + process as a whole should terminate or not. + [Jonathan Schilling ] + *) The manual page stated that system(3) is supported in the "Soft System Call Mapping", but in fact it was forgotten in the implementation. Index: ossp-pkg/pth/pth_lib.c RCS File: /v/ossp/cvs/ossp-pkg/pth/pth_lib.c,v rcsdiff -q -kk '-r1.48' '-r1.49' -u '/v/ossp/cvs/ossp-pkg/pth/pth_lib.c,v' 2>/dev/null --- pth_lib.c 2002/01/30 13:07:08 1.48 +++ pth_lib.c 2002/10/15 18:17:28 1.49 @@ -379,12 +379,21 @@ /* NOTICE: THIS FUNCTION EXECUTES FROM WITHIN THE SCHEDULER THREAD! */ + + /* calculate number of still existing threads in system. Only + skipped queue is pth_DQ (dead queue). This queue does not + count here, because those threads are non-detached but already + terminated ones -- and if we are the only remaining thread (which + also wants to terminate and not join those threads) we can signal + us through the scheduled event (for which we are running as the + test function inside the scheduler) that the whole process can + terminate now. */ rc = 0; rc += pth_pqueue_elements(&pth_NQ); rc += pth_pqueue_elements(&pth_RQ); rc += pth_pqueue_elements(&pth_WQ); rc += pth_pqueue_elements(&pth_SQ); - rc += pth_pqueue_elements(&pth_DQ); + if (rc == 1 /* just our main thread */) return TRUE; else