WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
22524
XMLHttpRequest needs to have the static defines made threadsafe.
https://bugs.webkit.org/show_bug.cgi?id=22524
Summary
XMLHttpRequest needs to have the static defines made threadsafe.
David Levin
Reported
2008-11-26 20:41:45 PST
This is part of making XHR available to workers.
Attachments
Removes the non-thread safe static initializations in XMLHttpRequest.cpp
(9.42 KB, patch)
2008-11-26 20:47 PST
,
David Levin
no flags
Details
Formatted Diff
Diff
Very minor adjustment to the last patch (-- moves one brace for style purposes).
(9.42 KB, patch)
2008-11-27 01:00 PST
,
David Levin
no flags
Details
Formatted Diff
Diff
Changed the static initialization to happen in the XHR constructor.
(9.14 KB, patch)
2008-11-27 23:13 PST
,
David Levin
no flags
Details
Formatted Diff
Diff
Another revision. I think it is close.
(9.27 KB, patch)
2008-11-28 01:14 PST
,
David Levin
ap
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
David Levin
Comment 1
2008-11-26 20:47:52 PST
Created
attachment 25548
[details]
Removes the non-thread safe static initializations in XMLHttpRequest.cpp
David Levin
Comment 2
2008-11-27 01:00:32 PST
Created
attachment 25555
[details]
Very minor adjustment to the last patch (-- moves one brace for style purposes).
Alexey Proskuryakov
Comment 3
2008-11-27 07:33:42 PST
Hmm... The patch is executed perfectly, but I think that it may be over-engineered a bit. I don't see how having classes for each function helps - is it better than just protecting initialization parts of these functions with a mutex?
David Levin
Comment 4
2008-11-27 23:13:35 PST
Created
attachment 25566
[details]
Changed the static initialization to happen in the XHR constructor. I didn't like doing a mutex in the functions due to one of them being called inside of a loop. As discussed, I've tried out a solution that initializes the static variables in the constructor. I looked at a few ways of doing this. The reason I put the variables in a struct and then initialized into a local static was to take advantage of AtomicallyInitializedStatic. If this doesn't seem that great, one alternative I can think of is to create another macro like AtomicallyInitializedStatic (in threading.h) that allowed me to call a function inside of this same mutex.
David Levin
Comment 5
2008-11-28 01:14:29 PST
Created
attachment 25568
[details]
Another revision. I think it is close.
Alexey Proskuryakov
Comment 6
2008-11-28 01:22:58 PST
Comment on
attachment 25568
[details]
Another revision. I think it is close. r=me
Alexey Proskuryakov
Comment 7
2008-11-28 02:24:35 PST
Committed revision 38827. I made a slight tweak I didn't think about earlier: made the global const.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug