Implementing (maybe working) Win32 memory.cc.

This commit is contained in:
Ben Vanik
2013-01-30 01:45:55 -08:00
parent ae4d8ad40e
commit 9e05d44723
2 changed files with 20 additions and 7 deletions

View File

@@ -1853,8 +1853,8 @@ static FORCEINLINE void x86_clear_lock(int* sl) {
#define CLEAR_LOCK(sl) x86_clear_lock(sl)
#else /* Win32 MSC */
#define CAS_LOCK(sl) interlockedexchange(sl, (LONG)1)
#define CLEAR_LOCK(sl) interlockedexchange (sl, (LONG)0)
#define CAS_LOCK(sl) interlockedexchange((volatile unsigned int*)sl, 1)
#define CLEAR_LOCK(sl) interlockedexchange((volatile unsigned int*)sl, 0)
#endif /* ... gcc spins locks ... */