Skip to content

Commit

Permalink
Pass pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 6, 2024
1 parent 6936149 commit 67fa445
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/or-tools/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ void init_constraint(Rice::Module& m) {
Model m;

std::atomic<bool> stopped(false);
std::atomic<bool>* stopped2 = &stopped;

if (!callback.is_nil()) {
// TODO figure out how to use callback with multiple cores
Expand All @@ -434,7 +435,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");
*stopped2 = callback.attr_get("@stopped");
})
);
}
Expand Down

0 comments on commit 67fa445

Please sign in to comment.