[Webkit-unassigned] [Bug 106740] Fix the atomicIncrement implementation for Windows
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 17 08:05:00 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=106740
--- Comment #6 from Zoltan Arvai <zarvai at inf.u-szeged.hu> 2013-01-17 08:06:47 PST ---
I tried a dirty implementation in Atomics.h, based on the linked blog content.
It builds fine, QtTestBrowser seems ok, MiniBrowser runs with strange duplicated output - but this can be caused by remote desktop connection that I use.
inline int64_t atomicIncrement(int64_t volatile* addend)
{
// return InterlockedIncrement64(reinterpret_cast<long volatile*>(addend));
__asm
{
mov edi, addend
mov eax, [edi] //read current value non-atomically here...
mov edx, [edi+4] // it's just a guess, if it's wrong we'll try again
tryAgain:
mov ebx, 1
mov ecx, 0
add ebx, eax
adc ecx, edx
lock cmpxchg8b qword ptr [edi]
jnz tryAgain
}
return *addend;
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list