Closed
Bug 230092
Opened 21 years ago
Closed 21 years ago
[FIX]improve hashtable stuff in event queue service
Categories
(Core :: XPCOM, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file, 3 obsolete files)
3.30 KB,
patch
|
danm.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
Die, returners of addrefed raw ptrs, die!
Assignee | ||
Comment 1•21 years ago
|
||
The changes to nsHashKeys were done by bsmedberg; r=me on those.
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 138404 [details] [diff] [review] Like this-ish darin, bsmedberg, could you review?
Attachment #138404 -
Flags: superreview?(darin)
Attachment #138404 -
Flags: review?(bsmedberg)
Assignee | ||
Updated•21 years ago
|
Priority: -- → P1
Summary: improve hashtable stuff in event queue service → [FIX]improve hashtable stuff in event queue service
Target Milestone: --- → mozilla1.7alpha
Updated•21 years ago
|
Attachment #138404 -
Flags: review?(bsmedberg) → review+
Assignee | ||
Comment 3•21 years ago
|
||
Attachment #138404 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #138404 -
Flags: superreview?(darin)
Assignee | ||
Updated•21 years ago
|
Attachment #138421 -
Flags: superreview?(brendan)
Attachment #138421 -
Flags: review?(bsmedberg)
Comment 4•21 years ago
|
||
Comment on attachment 138421 [details] [diff] [review] Oops. Forgot to init the hashtable... >--- xpcom/threads/nsEventQueueService.cpp 3 Dec 2003 23:53:22 -0000 1.41 >+++ xpcom/threads/nsEventQueueService.cpp 5 Jan 2004 16:46:48 -0000 nsEventQueueServiceImpl::PushThreadEventQueue(nsIEventQueue **aNewQueue) [snip] > if (ourChain) > ourChain->AppendQueue(newQueue); // append new queue to it > > *aNewQueue = newQueue; >- NS_IF_ADDREF(*aNewQueue); Don't you still need this?
Assignee | ||
Comment 5•21 years ago
|
||
No, I do not. See the part right above that: - nsCOMPtr<nsIEventQueue> newQueue; - MakeNewQueue((PRThread*)key.GetValue(), native, getter_AddRefs(newQueue)); // create new queue + nsIEventQueue* newQueue = nsnull; + MakeNewQueue(currentThread, native, &newQueue); // create new queue; addrefs
Comment 6•21 years ago
|
||
Comment on attachment 138421 [details] [diff] [review] Oops. Forgot to init the hashtable... ah yes, ok
Attachment #138421 -
Flags: review?(bsmedberg) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #138421 -
Flags: superreview?(brendan) → superreview?(darin)
Comment 7•21 years ago
|
||
Comment on attachment 138421 [details] [diff] [review] Oops. Forgot to init the hashtable... >Index: xpcom/threads/nsEventQueueService.h >- nsSupportsHashtable mEventQTable; >+ nsInterfaceHashtable<nsVoidPtrHashKey, nsIEventQueue> mEventQTable; > PRMonitor *mEventQMonitor; > }; nit: looks like some effort was previously made to line up the variable names in a column. maybe you want to either preserve that or simply eliminate the extra space in front of *mEventQMonitor? >Index: xpcom/threads/nsEventQueueService.cpp >+PR_STATIC_CALLBACK(PLDHashOperator) >+hash_enum_remove_queues(const void *aThread_ptr, >+ nsCOMPtr<nsIEventQueue>& aQueue, >+ void* closure) > { >- // 'aData' should be the eldest queue. >- nsIEventQueue *eldestQueue = (nsIEventQueue*)aData; >- >- nsCOMPtr<nsPIEventQueueChain> pie(do_QueryInterface(eldestQueue)); >+ // 'aQueue' should be the eldest queue. >+ nsCOMPtr<nsPIEventQueueChain> pie(do_QueryInterface(aQueue)); nitty nit: i think aQueue should be called "aEldestQueue" to preserve the self-documenting name. sr=darin
Attachment #138421 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 8•21 years ago
|
||
Attachment #138421 -
Attachment is obsolete: true
Assignee | ||
Comment 9•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 10•21 years ago
|
||
Comment on attachment 138729 [details] [diff] [review] Patch updated to nits nsEventQueueServiceImpl::CreateEventQueue(PRThread *aThread, PRBool aNative) + mEventQTable.Get(aThread, getter_AddRefs(queue)); do you need a strong reference? + nsCOMPtr<nsIEventQueue> queue; + mEventQTable.Get(currentThread, getter_AddRefs(queue)); and here?
Assignee | ||
Comment 11•21 years ago
|
||
> nsEventQueueServiceImpl::CreateEventQueue(PRThread *aThread, PRBool aNative) No, I guess I could push the strong ref down into the !queue case.... > and here? Also looks like it may be doable, yes. Wanna post patches? Or should I work on it when I get the chance to?
Comment 12•21 years ago
|
||
I'd prefer you to do it... I don't have much time this month
Assignee | ||
Comment 13•21 years ago
|
||
This has three changes: 1) Use GetWeak in those two spots 2) Fix what looks like an obvious bug in CreateEventQueue (passing wrong thread to MakeNewQueue). 3) Fix what looks like a bug in PushThreadEventQueue (looking at the original queue for the thread rather than the youngest one).
Assignee | ||
Updated•21 years ago
|
Attachment #138729 -
Attachment is obsolete: true
Assignee | ||
Comment 14•21 years ago
|
||
Reopening till I get that in.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 15•21 years ago
|
||
Comment on attachment 138763 [details] [diff] [review] Patch to that effect darin, would you review?
Attachment #138763 -
Flags: superreview?(darin)
Attachment #138763 -
Flags: review?(darin)
Attachment #138763 -
Flags: review?(darin) → review?(danm-moz)
Attachment #138763 -
Flags: review?(danm-moz) → review+
Comment 16•21 years ago
|
||
Comment on attachment 138763 [details] [diff] [review] Patch to that effect sr=darin
Attachment #138763 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 17•21 years ago
|
||
Checked that in too.
Status: REOPENED → RESOLVED
Closed: 21 years ago → 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•