From 069dabd73ff66ad93223bbeec2c157c37eb0a8fc Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 23 Jan 2011 23:37:18 -0800 Subject: qtgui use gruel thread mutex: Replace pthread mutex usage with gruel thread mutex to make the code portable on systems without pthreads. --- gr-qtgui/src/lib/qtgui.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gr-qtgui/src/lib/qtgui.h') diff --git a/gr-qtgui/src/lib/qtgui.h b/gr-qtgui/src/lib/qtgui.h index 6edbca12c..9831697ac 100644 --- a/gr-qtgui/src/lib/qtgui.h +++ b/gr-qtgui/src/lib/qtgui.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008 Free Software Foundation, Inc. + * Copyright 2008,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,30 +23,31 @@ #ifndef INCLUDED_QTGUI_H #define INCLUDED_QTGUI_H +#include #include #include "SpectrumGUIClass.h" class qtgui_event : public QEvent { private: - pthread_mutex_t *pmutex; + gruel::mutex &d_mutex; public: - qtgui_event(pthread_mutex_t *mut) - : QEvent((QEvent::Type)(QEvent::User+101)) + qtgui_event(gruel::mutex &mutex) + : QEvent((QEvent::Type)(QEvent::User+101)), + d_mutex(mutex) { - pmutex = mut; + //nop } void lock() { - pthread_mutex_lock(pmutex); - + d_mutex.lock(); } void unlock() { - pthread_mutex_unlock(pmutex); + d_mutex.unlock(); } }; -- cgit From befadabc2f18b483c71250adfd7dbf42f66b16f0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 27 Mar 2011 12:55:16 -0400 Subject: gr-qtgui: restructuring qtgui directory to new layout. --- gr-qtgui/src/lib/qtgui.h | 71 ------------------------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 gr-qtgui/src/lib/qtgui.h (limited to 'gr-qtgui/src/lib/qtgui.h') diff --git a/gr-qtgui/src/lib/qtgui.h b/gr-qtgui/src/lib/qtgui.h deleted file mode 100644 index 9831697ac..000000000 --- a/gr-qtgui/src/lib/qtgui.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008,2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_QTGUI_H -#define INCLUDED_QTGUI_H - -#include -#include -#include "SpectrumGUIClass.h" - -class qtgui_event : public QEvent -{ -private: - gruel::mutex &d_mutex; - -public: - qtgui_event(gruel::mutex &mutex) - : QEvent((QEvent::Type)(QEvent::User+101)), - d_mutex(mutex) - { - //nop - } - - void lock() - { - d_mutex.lock(); - } - - void unlock() - { - d_mutex.unlock(); - } -}; - -class qtgui_obj : public QObject -{ -public: - qtgui_obj(QObject *p) - : QObject(p) - { - } - - void customEvent(QEvent *e) - { - if(e->type() == (QEvent::Type)(QEvent::User+101)) { - qtgui_event *qt = (qtgui_event*)e; - qt->unlock(); - } - } -}; - -#endif /* INCLUDED_QTGUI_H */ -- cgit