Exemplo n.º 1
0
static void tSystemMessage(int priority, const char *msg, va_list ap)
{
    static QSystemSemaphore semaphore("TreeFrogSystemLog", 1, QSystemSemaphore::Open);
    TLog log(priority, QString().vsprintf(msg, ap).toLocal8Bit());
    QByteArray buf = TLogger::logToByteArray(log, syslogLayout, syslogDateTimeFormat);

    semaphore.acquire();  // Acquires the semaphore for system log
    if (!systemLog.fileName().isEmpty() && systemLog.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
        systemLog.write(buf.data());
        systemLog.flush();
        systemLog.close();
    }
    semaphore.release();  // Releases the semaphore
}
Exemplo n.º 2
0
 HbCacheLocker(QSystemSemaphore &semaphore) : semaphore(semaphore)
 {
     semaphore.acquire();
 }
Exemplo n.º 3
0
bool acquire_jt9_() {return sem_jt9.acquire();}