 
            Hmm... If the cache update is outside of the lock, more than one thread might have retrieved the sync and try to update the cache concurrently.
I think in the current state this will break as multiple thread may pass the `if (InterlockedCompareExchange( &cache->refcount, 0, 0 ))` check successfully.
Oh duh, I can't read.
I'll adjust this patch to get rid of the atomic cmpxchg mapping cache memory as we indeed don't need it anymore with the lock.
