Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 14, 2024
1 parent cec4dea commit f09d198
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ext/or-tools/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,11 @@ void init_constraint(Rice::Module& m) {
parameters.set_num_search_workers(1);
m.Add(NewSatParameters(parameters));

std::atomic<bool> stopped(false);
m.GetOrCreate<TimeLimit>()->RegisterExternalBooleanAsLimit(&stopped);
// std::atomic<bool> stopped(false);
// m.GetOrCreate<TimeLimit>()->RegisterExternalBooleanAsLimit(&stopped);
std::atomic<bool>* stopped = new std::atomic<bool>;
(*stopped) = false;
m.GetOrCreate<TimeLimit>()->RegisterExternalBooleanAsLimit(stopped);

if (!callback.is_nil()) {
m.Add(NewFeasibleSolutionObserver(
Expand All @@ -428,7 +431,7 @@ void init_constraint(Rice::Module& m) {
// TODO find a better way to do this
callback.call("response=", r);
callback.call("on_solution_callback");
stopped = callback.attr_get("@stopped").test();
(*stopped) = callback.attr_get("@stopped").test();
}
})
);
Expand Down

0 comments on commit f09d198

Please sign in to comment.