[Webkit-unassigned] [Bug 16596] ThreadSafeShared should be lock-free where possible

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 24 08:06:01 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=16596





------- Comment #2 from ap at webkit.org  2007-12-24 08:06 PDT -------
(From update of attachment 18091)
+#if COMPILER(MSVC)
+#include <windows.h>
+#endif

I think (though I'm not quite sure) that we avoid including windows.h in
headers to reduce conflicts.

Also, why is the check for COMPILER(MSVC), not PLATFORM(WIN_OS) or
PLATFORM(WIN)?

+inline void InterlockedIncrement(int volatile* addend)
+{
+#if PLATFORM(X86) || PLATFORM(X86_64)
+    __asm__(
+        "lock\n\t"

FWIW, OS X also has atomic functions, e.g. AddAtomic and DecrementAtomic. I'm
not sure if these are better or even suitable, but since you use an OS-provided
function on Windows, there should at least be a comment explaining why we don't
do the same on the Mac.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list