diff options
Diffstat (limited to 'gr-qtgui/src/lib/qtgui_sink_f.cc')
-rw-r--r-- | gr-qtgui/src/lib/qtgui_sink_f.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gr-qtgui/src/lib/qtgui_sink_f.cc b/gr-qtgui/src/lib/qtgui_sink_f.cc index ab4fd082d..984c2803c 100644 --- a/gr-qtgui/src/lib/qtgui_sink_f.cc +++ b/gr-qtgui/src/lib/qtgui_sink_f.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010 Free Software Foundation, Inc. + * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -72,7 +72,6 @@ qtgui_sink_f::qtgui_sink_f (int fftsize, int wintype, } d_main_gui = NULL; - pthread_mutex_init(&d_pmutex, NULL); lock(); // Perform fftshift operation; @@ -107,12 +106,12 @@ qtgui_sink_f::forecast(int noutput_items, gr_vector_int &ninput_items_required) void qtgui_sink_f::lock() { - pthread_mutex_lock(&d_pmutex); + d_mutex.lock(); } void qtgui_sink_f::unlock() { - pthread_mutex_unlock(&d_pmutex); + d_mutex.unlock(); } void @@ -146,7 +145,7 @@ qtgui_sink_f::initialize(const bool opengl) set_update_time(0.1); d_object = new qtgui_obj(d_qApplication); - qApp->postEvent(d_object, new qtgui_event(&d_pmutex)); + qApp->postEvent(d_object, new qtgui_event(d_mutex)); } void @@ -284,7 +283,7 @@ qtgui_sink_f::general_work (int noutput_items, int j=0; const float *in = (const float*)input_items[0]; - pthread_mutex_lock(&d_pmutex); + gruel::scoped_lock lock(d_mutex); // Update the FFT size from the application fftresize(); @@ -317,8 +316,6 @@ qtgui_sink_f::general_work (int noutput_items, } } - pthread_mutex_unlock(&d_pmutex); - consume_each(j); return j; } |