index 12fb75a5a7839fa66463736d66c01e1d9440aad2..762805518f7387914d492e99c62348c3f2a3a55a 100644 (file)
--- a/src/rrd_thread_safe_nt.c
+++ b/src/rrd_thread_safe_nt.c
/*****************************************************************************
- * RRDtool 1.3.0 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3.8 Copyright by Tobi Oetiker, 1997-2009
* This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
* & Tobias Oetiker
* Distributed under the GPL
/* Once-only initialisation of the key */
-static DWORD context_key_once = 0;
+static volatile LONG context_key_once = 0;
/* Free the thread-specific rrd_context - we might actually use
context_init_context();
- ctx = TlsGetValue(context_key);
+ ctx = (rrd_context_t*)(TlsGetValue(context_key));
if (!ctx) {
ctx = rrd_new_context();
TlsSetValue(context_key, ctx);
return ctx;
}
+#ifdef WIN32
+ rrd_context_t *rrd_force_new_context(void)
+ {
+ rrd_context_t *ctx;
+
+ context_init_context();
+
+ ctx = rrd_new_context();
+ TlsSetValue(context_key, ctx);
+
+ return ctx;
+ }
+#endif
+
#undef strerror
const char *rrd_strerror(
int err)