ben 97/06/15 15:27:14
Modified: src http_main.c multithread.h Log: Recover from the NT Experience. Revision Changes Path 1.151 +8 -8 apache/src/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache/src/http_main.c,v retrieving revision 1.150 retrieving revision 1.151 diff -C3 -r1.150 -r1.151 *** http_main.c 1997/06/15 19:22:26 1.150 --- http_main.c 1997/06/15 22:27:12 1.151 *************** *** 166,172 **** /* *Non*-shared http_main globals... */ server_rec *server_conf; ! JMP_BUF __declspec( thread ) jmpbuffer; int sd; static fd_set listenfds; static int listenmaxfd; --- 166,172 ---- /* *Non*-shared http_main globals... */ server_rec *server_conf; ! JMP_BUF APACHE_TLS jmpbuffer; int sd; static fd_set listenfds; static int listenmaxfd; *************** *** 351,361 **** * one timeout in progress at a time... */ ! static __declspec( thread ) conn_rec * current_conn; ! static __declspec( thread ) request_rec *timeout_req; ! static __declspec( thread ) char *timeout_name = NULL; ! static __declspec( thread ) int alarms_blocked = 0; ! static __declspec( thread ) int alarm_pending = 0; #ifndef NO_USE_SIGACTION /* --- 351,361 ---- * one timeout in progress at a time... */ ! static APACHE_TLS conn_rec * current_conn; ! static APACHE_TLS request_rec *timeout_req; ! static APACHE_TLS char *timeout_name = NULL; ! static APACHE_TLS int alarms_blocked = 0; ! static APACHE_TLS int alarm_pending = 0; #ifndef NO_USE_SIGACTION /* *************** *** 457,465 **** } ! static __declspec( thread ) void (*alarm_fn)(int) = NULL; #ifdef WIN32 ! static __declspec( thread ) unsigned int alarm_expiry_time = 0; #endif /* WIN32 */ unsigned int --- 457,465 ---- } ! static APACHE_TLS void (*alarm_fn)(int) = NULL; #ifdef WIN32 ! static APACHE_TLS unsigned int alarm_expiry_time = 0; #endif /* WIN32 */ unsigned int 1.2 +17 -10 apache/src/multithread.h Index: multithread.h =================================================================== RCS file: /export/home/cvs/apache/src/multithread.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C3 -r1.1 -r1.2 *** multithread.h 1997/06/15 19:22:33 1.1 --- multithread.h 1997/06/15 22:27:12 1.2 *************** *** 1,25 **** #ifndef MULTITHREAD_H #define MULTITHREAD_H - #include "conf.h" - #define MULTI_OK (0) #define MULTI_TIMEOUT (1) #define MULTI_ERR (2) - /* - * Ambarish: Need to do the right stuff on multi-threaded unix - * I believe this is terribly ugly - */ - #ifndef MULTITHREAD - #define __declspec( thread ) - #endif /* ndef MULTITHREAD */ - typedef void mutex; typedef void semaphore; typedef void thread; typedef void event; thread *create_thread(void (thread_fn)(void *thread_arg), void *thread_arg); int kill_thread(thread *thread_id); --- 1,21 ---- #ifndef MULTITHREAD_H #define MULTITHREAD_H #define MULTI_OK (0) #define MULTI_TIMEOUT (1) #define MULTI_ERR (2) typedef void mutex; typedef void semaphore; typedef void thread; typedef void event; + /* + * Ambarish: Need to do the right stuff on multi-threaded unix + * I believe this is terribly ugly + */ + #ifdef MULTITHREAD + #define APACHE_TLS __declspec( thread ) thread *create_thread(void (thread_fn)(void *thread_arg), void *thread_arg); int kill_thread(thread *thread_id); *************** *** 46,51 **** --- 42,58 ---- int set_event(event *event_id); int reset_event(event *event_id); void destroy_event(event *event_id); + + #else /* ndef MULTITHREAD */ + + #define APACHE_TLS + /* Only define the ones actually used, for now */ + #define create_mutex(name) NULL + #define acquire_mutex(mutex_id) MULTI_OK + #define release_mutex(mutex_id) MULTI_OK + + + #endif /* ndef MULTITHREAD */ #endif /* ndef MULTITHREAD_H */