D Paste by JimPanic
Description: None
Hide line numbers

Create new paste
Post a reply
View replies

Paste:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
        /* following line is 174 */
        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)
                            publish (q.channel);

                        if (q.isDirty)
                           {
                           q.flush;
                           log.info ("flushed "~q.channel.name~" to disk");
                           }
                        }

        }    

Replies:
No replies posted yet