index 8277ca48aec21dadcac6d0f95a0bde0efa9347d4..42c982b02f7838208f7321f3f7605e4c2b0ddf9a 100644 (file)
--- a/src/rrd_thread_safe_nt.c
+++ b/src/rrd_thread_safe_nt.c
/*****************************************************************************
- * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.4.6 Copyright by Tobi Oetiker, 1997-2012
* This file: Copyright 2003 Peter Stamfest <peter@stamfest.at>
* & Tobias Oetiker
* Distributed under the GPL
static void context_init_context(
void)
{
- if (!InterlockedExchange(&context_key_once, 1)) {
+ if (!InterlockedExchange((LONG*)(&context_key_once), 1)) {
context_key = TlsAlloc();
InitializeCriticalSection(&CriticalSection);
atexit(context_destroy_context);
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;
}
+
+/* this was added by the win32 porters Christof.Wegmann@exitgames.com */
+
+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;
+}
+
+
#undef strerror
const char *rrd_strerror(
int err)