added explanations about thread safe/unsafe module types
authoraland <aland>
Wed, 1 Nov 2000 20:13:06 +0000 (20:13 +0000)
committeraland <aland>
Wed, 1 Nov 2000 20:13:06 +0000 (20:13 +0000)
src/modules/rlm_example/rlm_example.c

index dd8eda9..bc87251 100644 (file)
@@ -183,10 +183,18 @@ static int radius_detach(void *instance)
        return 0;
 }
 
-/* globally exported name */
+/*
+ *     The module name should be the only globally exported symbol.
+ *     That is, everything else should be 'static'.
+ *
+ *     If the module needs to temporarily modify it's instantiation
+ *     data, the type should be changed to RLM_TYPE_THREAD_UNSAFE.
+ *     The server will then take care of ensuring that the module
+ *     is single-threaded.
+ */
 module_t rlm_example = {
-       "example",
-       0,                              /* type: reserved */
+       "example",      
+       RLM_TYPE_THREAD_SAFE,           /* type */
        radius_init,                    /* initialization */
        radius_instantiate,             /* instantiation */
        radius_authorize,               /* authorization */