collectd-perl(5): Don't actually use $interval_g in any examples.
[collectd.git] / src / plugin.h
index a2f7f09..3f2d98c 100644 (file)
@@ -99,8 +99,7 @@ struct value_list_s
 };
 typedef struct value_list_s value_list_t;
 
-#define VALUE_LIST_INIT { NULL, 0, 0, \
-       (plugin_interval > 0) ? plugin_interval : interval_g, \
+#define VALUE_LIST_INIT { NULL, 0, 0, plugin_get_interval (), \
        "localhost", "", "", "", "", NULL }
 #define VALUE_LIST_STATIC { NULL, 0, 0, 0, "localhost", "", "", "", "", NULL }
 
@@ -378,4 +377,22 @@ void plugin_init_ctx (void);
 plugin_ctx_t plugin_get_ctx (void);
 plugin_ctx_t plugin_set_ctx (plugin_ctx_t ctx);
 
+/*
+ * NAME
+ *  plugin_get_interval
+ *
+ * DESCRIPTION
+ *  This function returns the current value of the plugin's interval. The
+ *  return value will be strictly greater than zero in all cases. If
+ *  everything else fails, it will fall back to 10 seconds.
+ */
+cdtime_t plugin_get_interval (void);
+
+/*
+ * Context-aware thread management.
+ */
+
+int plugin_thread_create (pthread_t *thread, const pthread_attr_t *attr,
+               void *(*start_routine) (void *), void *arg);
+
 #endif /* PLUGIN_H */