rbb 99/10/21 07:31:29
Modified:src/lib/apr/include apr_portable.h
src/lib/apr/locks/unix intraproc.c locks.c locks.h
src/lib/apr/threadproc/unix thread.c threadcancel.c
threadpriv.c threadproc.h
Log:
Modify APR so that if we build without threads, we do not create no-op
functions.
Revision ChangesPath
1.9 +13 -3 apache-2.0/src/lib/apr/include/apr_portable.h
Index: apr_portable.h
===
RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_portable.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- apr_portable.h1999/10/11 17:51:47 1.8
+++ apr_portable.h1999/10/21 14:31:19 1.9
@@ -64,6 +64,7 @@
extern C {
#endif /* __cplusplus */
+#include apr_config.h
#include apr_general.h
#include apr_thread_proc.h
#include apr_file_io.h
@@ -165,18 +166,23 @@
#else
/* No Interprocess serialization, too bad. */
#endif
+#if APR_HAS_THREADS
+/* If no threads, no need for thread locks */
#if defined (USE_PTHREAD_SERIALIZE)
pthread_mutex_t *intraproc;
#endif
+#endif
};
typedef int ap_os_file_t;
typedef DIR ap_os_dir_t;
typedef int ap_os_sock_t;
typedef struct os_lock_t ap_os_lock_t;
+#if APR_HAS_THREADS HAVE_PTHREAD_H
typedef pthread_t ap_os_thread_t;
-typedef pid_t ap_os_proc_t;
typedef pthread_key_t ap_os_threadkey_t;
+#endif
+typedef pid_t ap_os_proc_t;
typedef struct timevalap_os_time_t;
#endif
@@ -184,19 +190,23 @@
ap_status_t ap_get_os_dir(ap_os_dir_t *, ap_dir_t *);
ap_status_t ap_get_os_sock(ap_os_sock_t *, ap_socket_t *);
ap_status_t ap_get_os_lock(ap_os_lock_t *, ap_lock_t *);
-ap_status_t ap_get_os_thread(ap_os_thread_t *, ap_thread_t *);
ap_status_t ap_get_os_proc(ap_os_proc_t *, ap_proc_t *);
ap_status_t ap_get_os_time(ap_os_time_t **, ap_time_t *);
+#if APR_HAS_THREADS HAVE_PTHREAD_H
+ap_status_t ap_get_os_thread(ap_os_thread_t *, ap_thread_t *);
ap_status_t ap_get_os_threadkey(ap_os_threadkey_t *, ap_key_t *);
+#endif
ap_status_t ap_put_os_file(ap_file_t **, ap_os_file_t *, ap_context_t *);
ap_status_t ap_put_os_dir(ap_dir_t **, ap_os_dir_t *, ap_context_t *);
ap_status_t ap_put_os_sock(ap_socket_t **, ap_os_sock_t *, ap_context_t *);
ap_status_t ap_put_os_lock(ap_lock_t **, ap_os_lock_t *, ap_context_t *);
-ap_status_t ap_put_os_thread(ap_thread_t **, ap_os_thread_t *, ap_context_t
*);
ap_status_t ap_put_os_proc(ap_proc_t **, ap_os_proc_t *, ap_context_t *);
ap_status_t ap_put_os_time(ap_time_t **, ap_os_time_t *, ap_context_t *);
+#if APR_HAS_THREADS HAVE_PTHREAD_H
+ap_status_t ap_put_os_thread(ap_thread_t **, ap_os_thread_t *, ap_context_t
*);
ap_status_t ap_put_os_threadkey(ap_key_t **, ap_os_threadkey_t *,
ap_context_t *);
+#endif
#ifdef __cplusplus
}
1.7 +4 -1 apache-2.0/src/lib/apr/locks/unix/intraproc.c
Index: intraproc.c
===
RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/intraproc.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- intraproc.c 1999/10/12 19:21:10 1.6
+++ intraproc.c 1999/10/21 14:31:20 1.7
@@ -52,12 +52,14 @@
* project, please see http://www.apache.org/.
*
*/
-
+#include apr_config.h
#include apr_lock.h
#include apr_general.h
#include apr_lib.h
#include locks.h
+#if APR_HAS_THREADS
+
#if defined (USE_PTHREAD_SERIALIZE)
ap_status_t lock_intra_cleanup(void *data)
@@ -119,4 +121,5 @@
}
return stat;
}
+#endif
#endif
1.11 +20 -0 apache-2.0/src/lib/apr/locks/unix/locks.c
Index: locks.c
===
RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/locks.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- locks.c 1999/10/15 14:20:01 1.10
+++ locks.c 1999/10/21 14:31:20 1.11
@@ -96,9 +96,13 @@
}
if (type != APR_CROSS_PROCESS) {
+#if APR_HAS_THREADS
if ((stat = create_intra_lock(new)) != APR_SUCCESS) {
return stat;
}
+#else
+return APR_ENOTIMPL;
+#endif
}
if (type != APR_INTRAPROCESS) {
if ((stat = create_inter_lock(new)) != APR_SUCCESS) {
@@ -118,9 +122,13 @@
{
ap_status_t stat;
if (lock-type != APR_CROSS_PROCESS) {
+#if APR_HAS_THREADS
if ((stat = lock_intra(lock)) != APR_SUCCESS) {
return stat;
}
+#else
+return APR_ENOTIMPL;