octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn'


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #44485] GUI: File | Exit from main menu doesn't work when Octave is busy
Date: Tue, 10 Mar 2015 07:55:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #11, bug #44485 (project octave):

Good question.  That error looks like it is coming from the Octave core,
right?  I assumed that quitting the application would gracefully stop the
Octave CLI thread.  But apparently not.  I'm going to think about this one for
a bit, and if you'd like to try something, let me know if it works.  It should
be just one or two strategically placed signals or function calls.

The question I have is whether we might have to stop the CLI thread (actually
two threads that I see).  The reason is that if we issue the current Qt signal
that causes and interrupt, i.e.,


  connect (command_window, SIGNAL (interrupt_signal (void)),
           _octave_qt_link, SLOT (terminal_interrupt (void)));


and


void
terminal_dock_widget::terminal_interrupt (void)
{
  emit interrupt_signal ();
}


it's doesn't solve this issue (I think) because signals across threads are
queued, slots across threads aren't processed immediately, unlike in-thread
signals/slots.  I think we'd have to simply stop the threads.

As I said, there are two threads, one for the octave CLI and one for the
command queue:


      QApplication application (argc, argv);

      octave_cli_thread main_thread (argc, argv);

      application.setQuitOnLastWindowClosed (false);

      main_thread.start ();

      return application.exec ();


and


octave_qt_link::octave_qt_link (QWidget *p)
  : octave_link (), main_thread (new QThread ()),
    command_interpreter (new octave_interpreter ())
{
  connect (this, SIGNAL (execute_interpreter_signal (void)),
           command_interpreter, SLOT (execute (void)));

  connect (command_interpreter, SIGNAL (octave_ready_signal ()),
           p, SLOT (handle_octave_ready ()));

  command_interpreter->moveToThread (main_thread);

  main_thread->start ();


We need some way of accessing and stopping these threads directly, not with
slots.  There need to be a couple extra pointers and short functions to do
that.

I'll think about for a day or so.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44485>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]