static void ScheduleProjectBuilderCleanup (DateTime cleanupTime)
{
lock (builders) {
if (cleanupTime < nextCleanup)
return;
nextCleanup = cleanupTime;
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
DateTime tnow = DateTime.Now;
while (tnow < nextCleanup) {
System.Threading.Thread.Sleep ((int)(nextCleanup - tnow).TotalMilliseconds);
CleanProjectBuilders ();
tnow = DateTime.Now;
}
});
}
}