void ThreadQueue::run(void) { data_t *prev; started = true; for(;;) { Semaphore::wait(); if(!started) sleep((timeout_t)~0); startQueue(); while(first) { runQueue(first->data); enterMutex(); prev = first; first = first->next; delete[] prev; if(!first) last = NULL; leaveMutex(); if(first) Semaphore::wait(); // demark semaphore } stopQueue(); } }
Sas32000::Sas32000(RDMatrix *matrix,QObject *parent,const char *name) : Switcher(matrix,parent,name) { // // Get Matrix Parameters // sas_inputs=matrix->inputs(); sas_outputs=matrix->outputs(); // // Initialize the TTY Port // RDTty *tty=new RDTty(rdstation->name(),matrix->port(RDMatrix::Primary)); sas_device=new RDTTYDevice(); if(tty->active()) { sas_device->setName(tty->port()); sas_device->setSpeed(tty->baudRate()); sas_device->setWordLength(tty->dataBits()); sas_device->setParity(tty->parity()); sas_device->open(IO_Raw|IO_ReadWrite); } delete tty; // // Queue Timer // sas_timer=new QTimer(this,"sas_timer"); connect(sas_timer,SIGNAL(timeout()),this,SLOT(runQueue())); }
void Database::submit( List< Query > *q ) { List< Query >::Iterator it( q ); while ( it ) { it->setState( Query::Submitted ); queries->append( it ); ++it; } runQueue(); }
ServerTask::Base* BasicServer::submit(Process* process) { QString msg(process->jobInfo()->get(JobInfo::BaseName)); msg += " submitted to server "; msg += m_server->name(); QLOG_INFO() << msg; m_queue.enqueue(process); process->setStatus(Process::Queued); runQueue(); return new ServerTask::DoNothing(m_server, msg); }
void Database::submit( Query *q ) { queries->append( q ); q->setState( Query::Submitted ); runQueue(); }