Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO](org.eclipse.net4j.util.ref.CleanableReferenceQueue)
[CDO] [message #1803464] Fri, 01 March 2019 07:09
Maxim Martynov is currently offline Maxim MartynovFriend
Messages: 22
Registered: February 2017
Junior Member
Hi.
In class org.eclipse.net4j.util.ref.CleanableReferenceQueue<T> we have method org.eclipse.net4j.util.ref.CleanableReferenceQueue.clean() which invoke everytime when revision fetch from server. But i don't understand why in method we check this condition if (lastPoll + pollMillis > now). By this logic if we have many request in minute logic is correct, but if request after 1 minute this condition not true and never will clean ReferenceQueue. I think condition sould be if (lastPoll + pollMillis < now).

public final void clean()
{
if (cleaning.compareAndSet(false, true))
{
long now = System.currentTimeMillis();
if (lastPoll + pollMillis > now)
{
int count = maxWorkPerPoll;
if (count == ALL_WORK_PER_POLL)
{
count = Integer.MAX_VALUE;
}

for (int i = 0; i < count; i++)
{
Reference<? extends T> reference = poll();
if (reference == null)
{
break;
}

cleanReference(reference);
}

lastPoll = now;
}

cleaning.set(false);
}
}
Previous Topic:Change behavior without modifying generated code
Next Topic:[CDO] Server : how to stop it properly
Goto Forum:
  


Current Time: Sun Jun 16 00:34:00 GMT 2019

Powered by FUDForum. Page generated in 0.01589 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top