Closed Bug 291123 Opened 19 years ago Closed 19 years ago

remove unused MOZ_THREADSAFE_RDF and locks from nsInMemoryDataSource

Categories

(Core Graveyard :: RDF, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: axel, Assigned: axel)

References

Details

Attachments

(1 file)

nsInMemoryDataSource has code fragments that claim to enable multi-threading locks
to the datasource.
They may even work, but they haven't been tested for years, I didn't even try
compiling those.
Anyway, the new API design has interfaces like rdfITripleVisitor,
http://wiki.mozilla.org/Rdf:Interfaces#rdfITripleVisitor
which is called for each arc in the result of a datasource query.
We need to protect the datasource from write operations during this operation.

In a multithreaded env this is tricky->hard, as a write from a read callback is
an error, while a write from a separate thread as a read is just supposed to 
wait.
As we don't use it, I'd like to get rid of it completely, so that we can just
error if we write during a read.
Attachment #181288 - Flags: superreview?(brendan)
Attachment #181288 - Flags: review?(benjamin)
Comment on attachment 181288 [details] [diff] [review]
remove unused lock code from nsInMemoryDataSource

Do you want to remove the "Locked*" function names while you're at it?
Attachment #181288 - Flags: review?(benjamin) → review+
(In reply to comment #2)
> Do you want to remove the "Locked*" function names while you're at it?

I did think about renaming them to something like InnerAssert or something, but
I didn't feel like that is really necessary.
I wouldn't remove them, as they are factored out from the Assert, the Move and the
Change code.
Comment on attachment 181288 [details] [diff] [review]
remove unused lock code from nsInMemoryDataSource

rs=brendan@mozilla.org.

/be
Attachment #181288 - Flags: superreview?(brendan) → superreview+
Comment on attachment 181288 [details] [diff] [review]
remove unused lock code from nsInMemoryDataSource

requesting approval, this patch is removing code NPOB.
Attachment #181288 - Flags: approval-aviary1.1a1?
Comment on attachment 181288 [details] [diff] [review]
remove unused lock code from nsInMemoryDataSource

Back end code, so 1.8b2+ but I'll throw in aviary1.1a1+ too!

/be
Attachment #181288 - Flags: approval1.8b2+
Attachment #181288 - Flags: approval-aviary1.1a1?
Attachment #181288 - Flags: approval-aviary1.1a1+
Drive by nit: The names "LockedAssert" and "LockedUnassert" seem to have been
chosen to reflect the fact that they are called while mLock is held.  Since you
are removing mLock, shouldn't you change the names of these functions?  Maybe
"InternalAssert" or something like that would be better?
There are more "drive by" nits to fix in this code, I prefer to land them in 
a distinct cycle, when I don't have other patches in my trees.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: