[
https://issues.apache.org/jira/browse/LUCENE-6129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255976#comment-14255976
]
Uwe Schindler commented on LUCENE-6129:
---------------------------------------
bq. Comparing by reference is enough; no two threads will have the same
reference.
I think the problem, Adrien was unsure about, was more the inverse: One thread
will never have multiple Thread instances, so it is a singleton instance per
thread. This is similar to the fact that you can compare Class instances by
reference, too.
The problem with Thread.getId() is that it returns something that may be reused
by different thread. So another thread, starting later, may have the same long
id. This is unlikely to happen here, but who knows...
> Assert that terms enums, docs enums and doc values are not leaked across
> threads
> --------------------------------------------------------------------------------
>
> Key: LUCENE-6129
> URL: https://issues.apache.org/jira/browse/LUCENE-6129
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Adrien Grand
> Assignee: Adrien Grand
> Priority: Minor
> Attachments: LUCENE-6129.patch
>
>
> Terms enums, docs enums and doc values should only be consumed in the thread
> that they have been acquired in. We could add checks to Asserting* to make
> sure they never leak?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]