Closed Bug 448476 Opened 17 years ago Closed 17 years ago

Make mozIStorageConnection threadsafe

Categories

(Core :: SQLite and Embedded Database Bindings, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1a2

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

Attachments

(1 file, 1 obsolete file)

People need to use it on more than one thread.
Blocks: 429988
Attached patch v1.0 (obsolete) — Splinter Review
Pretty simple :)
Attachment #331805 - Flags: review?(bent.mozilla)
Whiteboard: [has patch][needs review bent]
Shawn, I won't be able to get to this until next week.
Comment on attachment 331805 [details] [diff] [review] v1.0 Let's try myk then
Attachment #331805 - Flags: review?(bent.mozilla) → review?(myk)
Comment on attachment 331805 [details] [diff] [review] v1.0 Unfortunately, I'm not qualified to review this, not being familiar with the facility being used to ensure thread safety.
Attachment #331805 - Flags: review?(myk)
Comment on attachment 331805 [details] [diff] [review] v1.0 switching to robarnold - I'll have bent look at it post landing just to make sure of things.
Attachment #331805 - Flags: review?(tellrob)
Whiteboard: [has patch][needs review bent] → [has patch][needs review robarnold]
Comment on attachment 331805 [details] [diff] [review] v1.0 You need to document what each mutex guards Does Close need a lock around its "if(mProgressHandler)" block? In SetProgressHandler, shouldn't the lock be acquired before *aOldHandler = mProgressHandler? aOldHandler may not be what the caller expects. ReleaseProgressHandler seems to do this correctly.
(In reply to comment #6) > Does Close need a lock around its "if(mProgressHandler)" block? Reads should be atomic, but I think it's not a bad idea to do that to be safe > In SetProgressHandler, shouldn't the lock be acquired before *aOldHandler = > mProgressHandler? aOldHandler may not be what the caller expects. Yeah, I think you are right there as well.
Attached patch v1.1Splinter Review
I'm not documenting the mutexes because given their names and where they are declared in the header file (directly above the variables in question, with white space grouping them with said variable), I think it would be redundant, and excessive documentation isn't needed (nor wanted).
Attachment #331805 - Attachment is obsolete: true
Attachment #333128 - Flags: review?(tellrob)
Attachment #331805 - Flags: review?(tellrob)
Attachment #333128 - Flags: review?(tellrob) → review+
Whiteboard: [has patch][needs review robarnold] → [has patch][has review][can land]
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has review][can land]
Flags: in-testsuite-
Flags: in-litmus-
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: