Disabled ezminisat timeout feature for Win32
authorClifford Wolf <clifford@clifford.at>
Sat, 11 Oct 2014 08:24:46 +0000 (10:24 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 11 Oct 2014 08:24:46 +0000 (10:24 +0200)
libs/ezsat/ezminisat.cc
libs/ezsat/ezminisat.h

index 267355adab00656cd4325d5bd3ca0c6a0705ac95..b996d4a3dbaf8615c30194dc635adccd5ca3752c 100644 (file)
@@ -77,6 +77,7 @@ bool ezMiniSAT::eliminated(int idx)
 }
 #endif
 
+#ifndef _WIN32
 ezMiniSAT *ezMiniSAT::alarmHandlerThis = NULL;
 clock_t ezMiniSAT::alarmHandlerTimeout = 0;
 
@@ -88,6 +89,7 @@ void ezMiniSAT::alarmHandler(int)
        } else
                alarm(1);
 }
+#endif
 
 bool ezMiniSAT::solver(const std::vector<int> &modelExpressions, std::vector<bool> &modelValues, const std::vector<int> &assumptions)
 {
@@ -174,6 +176,7 @@ contradiction:
 #endif
        }
 
+#ifndef _WIN32
        struct sigaction sig_action;
        struct sigaction old_sig_action;
        int old_alarm_timeout = 0;
@@ -188,9 +191,11 @@ contradiction:
                sigaction(SIGALRM, &sig_action, &old_sig_action);
                alarm(1);
        }
+#endif
 
        bool foundSolution = minisatSolver->solve(assumps);
 
+#ifndef _WIN32
        if (solverTimeout > 0) {
                if (alarmHandlerTimeout == 0)
                        solverTimoutStatus = true;
@@ -198,6 +203,7 @@ contradiction:
                sigaction(SIGALRM, &old_sig_action, NULL);
                alarm(old_alarm_timeout);
        }
+#endif
 
        if (!foundSolution) {
 #if !EZMINISAT_INCREMENTAL
index ac9c071c36bc25c1b81e041fcbddc09b02347b74..5b5252d880ae554791d159c850c285d9e2ba00d6 100644 (file)
@@ -51,9 +51,11 @@ private:
        std::set<int> cnfFrozenVars;
 #endif
 
+#ifndef _WIN32
        static ezMiniSAT *alarmHandlerThis;
        static clock_t alarmHandlerTimeout;
        static void alarmHandler(int);
+#endif
 
 public:
        ezMiniSAT();