summaryrefslogtreecommitdiffstats
path: root/src/jomlib/jobclientacquirehelper.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-04-10 17:13:43 +0200
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-05-11 10:21:25 +0000
commita17aa85c4ae30d9a44fc2b10e919d94c3dfa3af3 (patch)
tree61e0a4b4f6d3b981e4931d69d5156ebeeabf2efb /src/jomlib/jobclientacquirehelper.h
parent98a33f71e75047a529b32f3c95b9fd479873371d (diff)
implement job server
Instead of trying to block recursive jom calls, use a job server similar to what GNU make provides. Task-number: QTCREATORBUG-10846 Change-Id: I0e17bb3a4e22e911da58f90e1bebc20aa5e6c75a Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/jomlib/jobclientacquirehelper.h')
-rw-r--r--src/jomlib/jobclientacquirehelper.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/jomlib/jobclientacquirehelper.h b/src/jomlib/jobclientacquirehelper.h
new file mode 100644
index 0000000..d0f82c8
--- /dev/null
+++ b/src/jomlib/jobclientacquirehelper.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2015 The Qt Company Ltd.
+ ** Contact: http://www.qt.io/licensing/
+ **
+ ** This file is part of the jom project on Trolltech Labs.
+ **
+ ** This file may be used under the terms of the GNU General Public
+ ** License version 2.0 or 3.0 as published by the Free Software Foundation
+ ** and appearing in the file LICENSE.GPL included in the packaging of
+ ** this file. Please review the following information to ensure GNU
+ ** General Public Licensing requirements will be met:
+ ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
+ ** http://www.gnu.org/copyleft/gpl.html.
+ **
+ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ **
+ ****************************************************************************/
+
+#ifndef JOBCLIENTACQUIRETHREAD_H
+#define JOBCLIENTACQUIRETHREAD_H
+
+#include <QObject>
+#include <QSystemSemaphore>
+
+namespace NMakeFile {
+
+class JobClientAcquireHelper : public QObject
+{
+ Q_OBJECT
+public:
+ explicit JobClientAcquireHelper(QSystemSemaphore *semaphore);
+
+public slots:
+ void acquire();
+
+signals:
+ void acquired();
+
+private:
+ QSystemSemaphore *m_semaphore;
+};
+
+} // namespace NMakeFile
+
+#endif // JOBCLIENTACQUIRETHREAD_H