Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Fix WASM build.
Browse files Browse the repository at this point in the history
  • Loading branch information
olonho committed Jun 15, 2018
1 parent 4028ae4 commit e61deac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions runtime/src/main/cpp/Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ ALWAYS_INLINE inline T compareAndSwap(volatile T* where, T expectedValue, T newV
#ifndef KONAN_NO_THREADS
return __sync_val_compare_and_swap(where, expectedValue, newValue);
#else
T oldValue = *location;
T oldValue = *where;
if (oldValue == expectedValue) {
*location = newValue;
}
return oldValue;
return *where += what;
*where = newValue;
}
return oldValue;
#endif
}

Expand Down

0 comments on commit e61deac

Please sign in to comment.