Arthur,
On Jan 3, 2007, at 9:04 AM, Arthur Kreitman wrote:
> I’m adding code to create new logs files periodically. This is on
> winnt. Since none of the log file support is thread safe, I want
> to add an access lock. I can’t seem to get apr_thread_mutex_t
> defined in httpd.h. I’ve added #include “apr_thead_mutex.h” to no
> avail, there’s some dependency I can’t quite see. Any of you
> experts know the magic incantation?
That should do the trick. What do you do to make sure your build
system can find that header? I have an example module,
mod_example_ipc.c, that uses global mutexes. It doesn't explicitly
include any APR mutex header, but I seem to be so lucky as to pick it
up automatically:
#include "apr.h"
#include "apr_strings.h"
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "ap_config.h"
#if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined
(NETWARE)
#include "unixd.h"
#define MOD_EXIPC_SET_MUTEX_PERMS /* XXX Apache should define
something */
#endif
#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if APR_HAVE_UNISTD_H
#include <unistd.h>
#endif
For more details, see http://www.temme.net/sander/mod_example_ipc/
S.
--
sctemme@xxxxxxxxxx http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4 B7B8 B2BE BC40 1529 24AF