+ if (key->notify != NULL)
+ {
+ destructor = malloc (sizeof (GPrivateDestructor));
+ if G_UNLIKELY (destructor == NULL)
+ g_thread_abort (errno, "malloc");
+ destructor->index = impl;
+ destructor->notify = key->notify;
+ destructor->next = g_private_destructors;
+
+ /* We need to do an atomic store due to the unlocked
+ * access to the destructor list from the thread exit
+ * function.
+ *
+ * It can double as a sanity check...
+ */
+ if (InterlockedCompareExchangePointer (&g_private_destructors, destructor,
+ destructor->next) != destructor->next)
+ g_thread_abort (0, "g_private_get_impl(1)");
+ }
+
+ /* Ditto, due to the unlocked access on the fast path */
+ if (InterlockedCompareExchangePointer (&key->p, impl, NULL) != NULL)
+ g_thread_abort (0, "g_private_get_impl(2)");
+ }
+ LeaveCriticalSection (&g_private_lock);
+ }
+
+ return impl;