From: Ken Raeburn Date: Wed, 2 Jun 2004 23:47:36 +0000 (+0000) Subject: * k5-thread.h: Error out at compile time if thread support is enabled but the X-Git-Tag: krb5-1.4-beta1~374 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4a7895d8c1f8b08ebd0e3bcfd975783fcc8bd057;p=krb5.git * k5-thread.h: Error out at compile time if thread support is enabled but the thread system isn't pthreads. (This is after the code disabling thread support for non-pthreads systems, so it's a placeholder for now that should never get invoked.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16393 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 87707074e..9fe30891b 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,10 @@ 2004-06-02 Ken Raeburn + * k5-thread.h: Error out at compile time if thread support is + enabled but the thread system isn't pthreads. (This is after the + code disabling thread support for non-pthreads systems, so it's a + placeholder for now that should never get invoked.) + * k5-int.h (struct krb5_rc_st, struct _krb5_rc_ops, krb5_rc_ops): Move type definitions to rc-int.h. (krb5_rc_register_type, krb5_rc_dfl_ops): Move declarations to diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h index 24ce6770d..dcdd49283 100644 --- a/src/include/k5-thread.h +++ b/src/include/k5-thread.h @@ -90,6 +90,13 @@ For non-threaded case: A simple flag. For Windows: Not needed; library init code takes care of it. + XXX: A general k5_once mechanism isn't possible for Windows, + without faking it through named mutexes or mutexes initialized at + startup. I was only using it in one place outside these headers, + so I'm dropping the general scheme. Eventually the existing uses + in k5-thread.h and k5-platform.h will be converted to pthread_once + or static variables. + Thread-specific data: @@ -181,6 +188,8 @@ typedef enum { #ifdef ENABLE_THREADS +#ifdef HAVE_PTHREAD_H + #include /* To do: Weak symbol support. Windows threads. @@ -296,6 +305,17 @@ typedef pthread_once_t k5_once_t; #define k5_once pthread_once #endif +#elif defined(_WIN32) + +# error "Windows thread support not implemented yet" +/* N.B.: No k5_once support for this platform. */ + +#else + +# error "Thread support enabled, but thread system unknown" + +#endif + #else /* ! ENABLE_THREADS */ #ifdef DEBUG_THREADS