apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@ebuilt.com>
Subject [PATCH] Fix apr_thread_exit(), change apr_thread_start_t, etc...
Date Wed, 18 Jul 2001 07:04:43 GMT
This patch provides a few fixes and a couple changes to the APR
threads API as discussed on this list. This does not implement the
controversial issues from the list, but merly a couple bug fixes I've
found and a widening of the worker_fn() parameters to make it possible
for applications to call functions like apr_thread_exit() and actually
use the childpool that is implicitly created.

In all cases they were tested on Unix (using my Linux 2.4 box). I
attempted to get the code for beos, os2, and win32 as close to
what I think it should be, but others will have to verify my changes:

1) Fix to apr_thread_join() -- it wasn't setting the return value correctly.

2) Added a new test in test/testthread.c to verify that the above works.

3) Changed the prototype for apr_thread_start_t to pass in the pool context
  and the apr_thread_t structure for a couple reasons:
   a) apr_thread_exit() requires the apr_thread_t, this makes it explicit
      to the application developer where that comes from.
   b) apr_thread_create() was creating a child-pool but only saving that
      child pool in the private platform-specific apr_thread_t struct
      definition, making it unavailable to the actual thread. Now it is
      directly available and the app programmer knows exactly from which
      pool to do allocations/cleanup registrations.

Like I said, I tested this on my Linux box, and did my best on the rest.
Win32 was the most unique implementation, so it would be best if someone
could run the new test/testthread to see if that was even working before
and that it works now (it was broken on unix and beos, os2 was ok IIRC).


View raw message