[Webkit-unassigned] [Bug 41792] [WINCE] Implement TCSpinLock

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 23 08:25:58 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41792


Adam Roben (aroben) <aroben at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #60768|review?, commit-queue?      |review-
               Flag|                            |




--- Comment #3 from Adam Roben (aroben) <aroben at apple.com>  2010-07-23 08:25:58 PST ---
(From update of attachment 60768)
> +#elif OS(WINDOWS)

I don't understand how this code will be compiled for WinCE. The first branch of this #if/#elif chain is:

#if (CPU(X86) || CPU(X86_64) || CPU(PPC)) && (COMPILER(GCC) || COMPILER(MSVC))

Will WinCE not match that condition?

> +    LONG m_lockword;

I think m_lockword is supposed to be a volatile LONG.


> +static void TCMalloc_SlowLock(LPLONG lockword) {
> +    Sleep(0);        // Yield immediately since fast path failed
> +    while (true) {
> +        if (!InterlockedExchange(lockword, 1))
> +            return;
> +
> +        Sleep(2);
> +    }
> +}

This could be a little simpler:

Sleep(0);
while (InterlockedExchange(lockword, 1))
    Sleep(2);

-- 
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