Commit f032d6ff authored by legoc's avatar legoc
Browse files

Renamed App cancelWaitFor() in cancel()

parent e27fcebd
......@@ -816,7 +816,7 @@ public:
/**
* Cancels the blocking waitFor() in another thread.
*/
void cancelWaitFor();
void cancel();
/**
* Gets the last state.
......
......@@ -720,7 +720,7 @@ bool App::kill() {
State App::waitFor(int states, KeyValue& keyValue, bool blocking) {
// Create a scoped waiting so that it is removed at the exit of the function.
Waiting scopedWaiting {std::bind(&App::cancelWaitFor, this)};
Waiting scopedWaiting {std::bind(&App::cancel, this)};
// Test the terminal state.
if (m_lastState == SUCCESS
......@@ -814,8 +814,8 @@ State App::waitFor(KeyValue& keyValue) {
return waitFor(0, keyValue, true);
}
void App::cancelWaitFor() {
cancel(m_id);
void App::cancel() {
EventListener::cancel(m_id);
}
State App::getLastState() {
......
......@@ -757,7 +757,7 @@ public class App extends EventListener {
/**
* Cancels the blocking waitFor() in another thread.
*/
public void cancelWaitFor() {
public void cancel() {
cancel(id);
}
......
......@@ -34,7 +34,7 @@ public class AppWaiting extends Waiting {
@Override
public void cancel() {
instance.cancelWaitFor();
instance.cancel();
}
@Override
......
......@@ -137,7 +137,7 @@ PYBIND11_MODULE(cameopy, m) {
.def("waitFor", py::overload_cast<int>(&App::waitFor),
"states"_a,
py::call_guard<py::gil_scoped_release>())
.def("cancelWaitFor", &App::cancelWaitFor, py::call_guard<py::gil_scoped_release>())
.def("cancel", &App::cancel, py::call_guard<py::gil_scoped_release>())
.def("getLastState", &App::getLastState, py::call_guard<py::gil_scoped_release>())
.def("getActualState", &App::getActualState, py::call_guard<py::gil_scoped_release>())
.def("getPastStates", &App::getPastStates, py::call_guard<py::gil_scoped_release>())
......
......@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
// Start thread.
thread cancelThread([&] {
this_thread::sleep_for(chrono::seconds(1));
stopApplication->cancelWaitFor();
stopApplication->cancel();
});
State state = stopApplication->waitFor();
......
......@@ -88,7 +88,7 @@ public class TestCancel {
public void run() {
try {
Thread.sleep(1000);
stopApplication.cancelWaitFor();
stopApplication.cancel();
} catch (InterruptedException e) {
}
......
......@@ -9,7 +9,7 @@ def cancelAll():
def cancelWaitFor(instance):
time.sleep(1)
instance.cancelWaitFor()
instance.cancel()
def cancelWaitForSubscribers(publisher):
time.sleep(1)
......
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