Commit 20060943 authored by Mathieu Giraud's avatar Mathieu Giraud

core/windowExtractor.cpp: handles SIGINT during first pass (window detection)

see #4286
parent b05aa8de
...@@ -27,8 +27,17 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads, ...@@ -27,8 +27,17 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads,
unsigned long long int bp_total = 0; unsigned long long int bp_total = 0;
global_interrupted = false ;
signal(SIGINT, sigintHandler);
while (reads->hasNext()) { while (reads->hasNext()) {
if (global_interrupted)
{
cout << WARNING_STRING << "Interrupted after processing " << nb_reads << " reads" << endl ;
break;
}
try { try {
reads->next(); reads->next();
} }
...@@ -119,6 +128,7 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads, ...@@ -119,6 +128,7 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads,
cout.flush() ; cout.flush() ;
} }
} }
signal(SIGINT, SIG_DFL);
cout << endl ; cout << endl ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment