http://d.puremagic.com/issues/show_bug.cgi?id=1337





--- Comment #4 from Sobirari Muhomori <ma...@pochta.ru>  2009-07-10 04:41:07 
PDT ---
This can be a test case, I didn't check it for 1.018, it works on 2.031.

---
struct QueueFile{ int size,channel; }
class A
{
   QueueFile[] queueList;
   final synchronized void copy (QueueFile[] dst, QueueFile src[])
   {
      dst[] = src;
   }
   final void watchdog ()
   {
      auto len = queueList.length;
      auto list = (cast(QueueFile*) alloca(len * QueueFile.sizeof))[0..len];

      // clone the list of queues to avoid stalling everything
      //copy (list, queueList);

      synchronized (this)
         memcpy (list.ptr, queueList.ptr, len * (QueueFile*).sizeof);
         //list[] = queueList;

      foreach (q; list)
      {
         if (q.size)
             writeln (q.channel);
         //if (q.isDirty)
         //{
         //    q.flush;
         //    log.info ("flushed "~q.channel.name~" to disk");
         //}
      }
   }
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to