octave-maintainers
[Top][All Lists]
Advanced

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

ctrl-c and oct files


From: John Donoghue
Subject: ctrl-c and oct files
Date: Mon, 30 Apr 2018 19:37:03 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

I have an on file that calls some os code - just as a single example:

#include <octave/oct.h>
#include <unistd.h>

DEFUN_DLD (testctrl, args, nargout, "Test Ctrl-C")
{
  printf("starting sleep\n");

  BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;

  sleep(10);

  END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE;

  printf("finished sleep\n");
  return octave_value();
}

Build with mkoctfile, in fedora 26, with octave 4.3.92, hg 25327:abc5095d58c2


Running it with octave --no-gui, when I run testctrl, and press ctrl-c after a second, shouldn't the code break out?

Currently, for me, ctrl-c doesnt appear to do anything - the prints execute after the 10 second sleep, rather than breaking out part way through the sleep.

octave --gui does the same.







reply via email to

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