diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2012-01-02 18:07:43 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2012-01-02 18:07:43 (GMT) |
commit | 131eed660716a2a8b52a6956f8e8a136425c404e (patch) | |
tree | 99ba06a0196fc4bc6e8eb84b1ff75fc984e89b92 /Source/cmSystemTools.cxx | |
parent | 40aedcbbaeddcb7e088c56e30f4252171e920baa (diff) | |
download | CMake-131eed660716a2a8b52a6956f8e8a136425c404e.zip CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.gz CMake-131eed660716a2a8b52a6956f8e8a136425c404e.tar.bz2 |
cmake-gui: Improve interrupt granularity to fix bug 12649.
Instead of enabling interrupt only when a progress or message callback is called, add a new callback specifically for
interrupt. This new callback is called from GetFatalErrorOccured() so cmake-gui can immediately report interrupt status
instead of calling queuing a call to cmSystemTools::SetFatalErrorOccured() and waiting for the progress or message
callback to be called to process that queued call.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 8eec1e2..920a84a 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -131,6 +131,8 @@ void (*cmSystemTools::s_ErrorCallback)(const char*, const char*, void (*cmSystemTools::s_StdoutCallback)(const char*, int len, void*); void* cmSystemTools::s_ErrorCallbackClientData = 0; void* cmSystemTools::s_StdoutCallbackClientData = 0; +bool (*cmSystemTools::s_InterruptCallback)(void*); +void* cmSystemTools::s_InterruptCallbackClientData = 0; // replace replace with with as many times as it shows up in source. // write the result into source. @@ -220,6 +222,20 @@ void cmSystemTools::Error(const char* m1, const char* m2, cmSystemTools::Message(message.c_str(),"Error"); } +void cmSystemTools::SetInterruptCallback(InterruptCallback f, void* clientData) +{ + s_InterruptCallback = f; + s_InterruptCallbackClientData = clientData; +} + +bool cmSystemTools::GetInterruptFlag() +{ + if(s_InterruptCallback) + { + return (*s_InterruptCallback)(s_InterruptCallbackClientData); + } + return false; +} void cmSystemTools::SetErrorCallback(ErrorCallback f, void* clientData) { |