diff --git a/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/Pipeline.lf b/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/Pipeline.lf index 512ae506c1..3433d86606 100644 --- a/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/Pipeline.lf +++ b/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/Pipeline.lf @@ -54,7 +54,7 @@ reactor Receive { in->value ); if (in->value >= 10) { - request_stop(); + lf_request_stop(); } =} } diff --git a/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/ReflexGame.lf b/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/ReflexGame.lf index fa67d27923..96cace593f 100644 --- a/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/ReflexGame.lf +++ b/org.lflang.ui/src/org/lflang/ui/wizard/templates/c/src/ReflexGame.lf @@ -101,14 +101,14 @@ reactor GetUserInput { reaction(user_response) -> another {= if (user_response->value == EOF) { - request_stop(); + lf_request_stop(); return; } // If the prompt_time is 0, then the user is cheating and // hitting return before being prompted. if (self->prompt_time == 0LL) { printf("YOU CHEATED!\n"); - request_stop(); + lf_request_stop(); } else { int time_in_ms = (lf_time_logical() - self->prompt_time) / 1000000LL; printf("Response time in milliseconds: %d\n", time_in_ms); diff --git a/test/C/src/PingPong.lf b/test/C/src/PingPong.lf index e518ba9649..3d62082713 100644 --- a/test/C/src/PingPong.lf +++ b/test/C/src/PingPong.lf @@ -36,7 +36,7 @@ reactor Ping(count:int(10)) { if (self->pingsLeft > 0) { lf_schedule(serve, 0); } else { - request_stop(); + lf_request_stop(); } =} } diff --git a/test/C/src/RequestStop.lf b/test/C/src/RequestStop.lf index 2bf4244e00..282712aa6d 100644 --- a/test/C/src/RequestStop.lf +++ b/test/C/src/RequestStop.lf @@ -1,11 +1,11 @@ -// Test verifying that request_stop() called in a shutdown reaction is ignored. +// Test verifying that lf_request_stop() called in a shutdown reaction is ignored. target C; main reactor { reaction(shutdown) {= tag_t current_time = lf_tag(); - lf_print("Shutdown invoked at tag (%lld, %d). Calling request_stop(), which should have no effect.", + lf_print("Shutdown invoked at tag (%lld, %d). Calling lf_request_stop(), which should have no effect.", current_tag.time - lf_time_start(), current_tag.microstep ); - request_stop(); + lf_request_stop(); =} -} \ No newline at end of file +} diff --git a/test/C/src/Stop.lf b/test/C/src/Stop.lf index abea4858b3..03370fd8ee 100644 --- a/test/C/src/Stop.lf +++ b/test/C/src/Stop.lf @@ -1,5 +1,5 @@ /* - * A test for the request_stop() functionality in Lingua Franca. + * A test for the lf_request_stop() functionality in Lingua Franca. * * @author Soroush Bateni */ @@ -21,9 +21,9 @@ reactor Consumer { exit(1); } else if (lf_tag_compare(current_tag, (tag_t) { .time = MSEC(10) + lf_time_start(), .microstep = 8}) == 0) { - // Call request_stop() at relative tag (10 msec, 8) + // Call lf_request_stop() at relative tag (10 msec, 8) printf("Requesting stop.\n"); - request_stop(); + lf_request_stop(); } else if (lf_tag_compare(current_tag, (tag_t) { .time = MSEC(10) + lf_time_start(), .microstep = 9}) == 0) { // Check that this reaction is indeed also triggered at (10 msec, 9) diff --git a/test/C/src/StopZero.lf b/test/C/src/StopZero.lf index 0a20f23f18..692e939e04 100644 --- a/test/C/src/StopZero.lf +++ b/test/C/src/StopZero.lf @@ -1,7 +1,7 @@ /** - * Test for request_stop() at tag (0,0). + * Test for lf_request_stop() at tag (0,0). * This also tests for logically simultaneous calls - * to request_stop(). + * to lf_request_stop(). * * @author Soroush Bateni */ @@ -25,7 +25,7 @@ reactor Sender { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } else if (lf_tag_compare(lf_tag(), one) > 0) { fprintf(stderr, "ERROR: Reaction called after shutdown at (%lld, %u).\n", lf_time_logical_elapsed(), @@ -74,7 +74,7 @@ reactor Receiver { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } =} diff --git a/test/C/src/TimeLimit.lf b/test/C/src/TimeLimit.lf index f2b0912279..7ff27990cf 100644 --- a/test/C/src/TimeLimit.lf +++ b/test/C/src/TimeLimit.lf @@ -45,7 +45,7 @@ reactor Destination { main reactor TimeLimit(period:time(1 usec)) { timer stop(10 secs); reaction(stop) {= - request_stop(); + lf_request_stop(); =} c = new Clock(period = period); d = new Destination(); diff --git a/test/C/src/concurrent/PingPongThreaded.lf b/test/C/src/concurrent/PingPongThreaded.lf index 8d867ec87a..5d74429f72 100644 --- a/test/C/src/concurrent/PingPongThreaded.lf +++ b/test/C/src/concurrent/PingPongThreaded.lf @@ -36,7 +36,7 @@ reactor Ping(count:int(10)) { if (self->pingsLeft > 0) { lf_schedule(serve, 0); } else { - request_stop(); + lf_request_stop(); } =} } diff --git a/test/C/src/concurrent/StopThreaded.lf b/test/C/src/concurrent/StopThreaded.lf index 7742a0433e..c155afe107 100644 --- a/test/C/src/concurrent/StopThreaded.lf +++ b/test/C/src/concurrent/StopThreaded.lf @@ -1,5 +1,5 @@ /* - * A test for the request_stop() functionality in Lingua Franca. + * A test for the lf_request_stop() functionality in Lingua Franca. * This version of the test is threaded. * * @author Soroush Bateni @@ -26,9 +26,9 @@ reactor Consumer { current_tag.time - lf_time_start(), current_tag.microstep); } else if (lf_tag_compare(current_tag, (tag_t) { .time = MSEC(10) + lf_time_start(), .microstep = 8}) == 0) { - // Call request_stop() at relative tag (10 msec, 8) + // Call lf_request_stop() at relative tag (10 msec, 8) lf_print("Requesting stop."); - request_stop(); + lf_request_stop(); } else if (lf_tag_compare(current_tag, (tag_t) { .time = MSEC(10) + lf_time_start(), .microstep = 9}) == 0) { // Check that this reaction is indeed also triggered at (10 msec, 9) diff --git a/test/C/src/concurrent/StopZeroThreaded.lf b/test/C/src/concurrent/StopZeroThreaded.lf index 6cf14def29..b90797e664 100644 --- a/test/C/src/concurrent/StopZeroThreaded.lf +++ b/test/C/src/concurrent/StopZeroThreaded.lf @@ -1,5 +1,5 @@ /** - * Test for request_stop() at tag (0,0). + * Test for lf_request_stop() at tag (0,0). * This version uses the threaded runtime. * * @author Soroush Bateni @@ -25,7 +25,7 @@ reactor Sender { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } else if (lf_tag_compare(lf_tag(), one) > 0) { fprintf(stderr, "ERROR: Reaction called after shutdown at (%lld, %u).\n", lf_time_logical_elapsed(), @@ -74,7 +74,7 @@ reactor Receiver { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } =} diff --git a/test/C/src/concurrent/TimeLimitThreaded.lf b/test/C/src/concurrent/TimeLimitThreaded.lf index d23c7bd8b4..86feb23294 100644 --- a/test/C/src/concurrent/TimeLimitThreaded.lf +++ b/test/C/src/concurrent/TimeLimitThreaded.lf @@ -40,7 +40,7 @@ reactor Destination { main reactor (period:time(1 usec)) { timer stop(10 secs); reaction(stop) {= - request_stop(); + lf_request_stop(); =} c = new Clock(period = period); d = new Destination(); diff --git a/test/C/src/docker/federated/DistributedStopDecentralizedContainerized.lf b/test/C/src/docker/federated/DistributedStopDecentralizedContainerized.lf index d1f8d2931c..334c0fe7e4 100644 --- a/test/C/src/docker/federated/DistributedStopDecentralizedContainerized.lf +++ b/test/C/src/docker/federated/DistributedStopDecentralizedContainerized.lf @@ -1,5 +1,5 @@ /** - * Test for request_stop() in federated execution with decentralized coordination. + * Test for lf_request_stop() in federated execution with decentralized coordination. * * @author Soroush Bateni */ diff --git a/test/C/src/federated/CycleDetection.lf b/test/C/src/federated/CycleDetection.lf index 6253d27dc9..d9df75b330 100644 --- a/test/C/src/federated/CycleDetection.lf +++ b/test/C/src/federated/CycleDetection.lf @@ -39,7 +39,7 @@ reactor UserInput { lf_print_error_and_exit("Did not receive the expected balance. Expected: 200. Got: %d.", balance->value); } lf_print("Balance: %d", balance->value); - request_stop(); + lf_request_stop(); =} reaction(shutdown) {= diff --git a/test/C/src/federated/DistributedCountPhysicalAfterDelay.lf b/test/C/src/federated/DistributedCountPhysicalAfterDelay.lf index 19ded83fd0..9643da43a6 100644 --- a/test/C/src/federated/DistributedCountPhysicalAfterDelay.lf +++ b/test/C/src/federated/DistributedCountPhysicalAfterDelay.lf @@ -27,7 +27,7 @@ reactor Print { exit(3); } self->c++; - request_stop(); + lf_request_stop(); =} reaction(shutdown) {= if (self->c != 2) { diff --git a/test/C/src/federated/DistributedLoopedActionDecentralized.lf b/test/C/src/federated/DistributedLoopedActionDecentralized.lf index 3392b56893..68a4d84b45 100644 --- a/test/C/src/federated/DistributedLoopedActionDecentralized.lf +++ b/test/C/src/federated/DistributedLoopedActionDecentralized.lf @@ -103,7 +103,7 @@ reactor STPReceiver(take_a_break_after:int(10), break_interval:time(400 msec), s if (current_tag.time != self->last_time_updated_stp) { lf_print("Raising the STP offset by %lld.", MSEC(10)); self->stp_offset += MSEC(10); - set_stp_offset(MSEC(10)); + lf_set_stp_offset(MSEC(10)); self->last_time_updated_stp = current_tag.time; } =} diff --git a/test/C/src/federated/DistributedStop.lf b/test/C/src/federated/DistributedStop.lf index f803edb94c..943e04920f 100644 --- a/test/C/src/federated/DistributedStop.lf +++ b/test/C/src/federated/DistributedStop.lf @@ -1,5 +1,5 @@ /** - * Test for request_stop() in federated execution with centralized coordination. + * Test for lf_request_stop() in federated execution with centralized coordination. * * @author Soroush Bateni */ @@ -18,17 +18,17 @@ reactor Sender { if (lf_tag().microstep == 0) { // Instead of having a separate reaction // for 'act' like Stop.lf, we trigger the - // same reaction to test request_stop() being + // same reaction to test lf_request_stop() being // called multiple times lf_schedule(act, 0); } if (lf_time_logical_elapsed() == USEC(1)) { - // Call request_stop() both at (1 usec, 0) and + // Call lf_request_stop() both at (1 usec, 0) and // (1 usec, 1) lf_print("Requesting stop at (%lld, %u).", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } tag_t _1usec1 = (tag_t) { .time = USEC(1) + lf_time_start(), .microstep = 1u }; @@ -74,7 +74,7 @@ reactor Receiver ( lf_print("Requesting stop at (%lld, %u).", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); // The receiver should receive a message at tag // (1 usec, 1) and trigger this reaction self->reaction_invoked_correctly = true; diff --git a/test/C/src/federated/DistributedStopDecentralized.lf b/test/C/src/federated/DistributedStopDecentralized.lf index d38d14eaaa..53ab5809bd 100644 --- a/test/C/src/federated/DistributedStopDecentralized.lf +++ b/test/C/src/federated/DistributedStopDecentralized.lf @@ -1,17 +1,17 @@ /** - * Test for request_stop() in federated execution with decentralized coordination. + * Test for lf_request_stop() in federated execution with decentralized coordination. * * @author Soroush Bateni */ -target C { - coordination: decentralized +target C { + coordination: decentralized }; import Sender, Receiver from "DistributedStop.lf" -federated reactor DistributedStopDecentralized { +federated reactor DistributedStopDecentralized { sender = new Sender(); receiver = new Receiver(); - sender.out -> receiver.in; -} \ No newline at end of file + sender.out -> receiver.in; +} diff --git a/test/C/src/federated/DistributedStopZero.lf b/test/C/src/federated/DistributedStopZero.lf index 1f3bac62e6..d4bc66d88a 100644 --- a/test/C/src/federated/DistributedStopZero.lf +++ b/test/C/src/federated/DistributedStopZero.lf @@ -1,5 +1,5 @@ /** - * Test for request_stop() in federated execution with centralized coordination + * Test for lf_request_stop() in federated execution with centralized coordination * at tag (0,0). * * @author Soroush Bateni @@ -21,7 +21,7 @@ reactor Sender { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } =} @@ -53,7 +53,7 @@ reactor Receiver { printf("Requesting stop at (%lld, %u).\n", lf_time_logical_elapsed(), lf_tag().microstep); - request_stop(); + lf_request_stop(); } =} diff --git a/test/C/src/federated/DistributedStopZeroDecentralized.lf b/test/C/src/federated/DistributedStopZeroDecentralized.lf index b9fc6d40f1..9cc4f39645 100644 --- a/test/C/src/federated/DistributedStopZeroDecentralized.lf +++ b/test/C/src/federated/DistributedStopZeroDecentralized.lf @@ -1,5 +1,5 @@ /** - * Test for request_stop() in federated execution with decentralized coordination + * Test for lf_request_stop() in federated execution with decentralized coordination * at tag (0,0). * * @author Soroush Bateni @@ -8,9 +8,9 @@ target C; import Sender, Receiver from "DistributedStopZero.lf" -federated reactor { +federated reactor { sender = new Sender(); receiver = new Receiver(); - sender.out -> receiver.in; -} \ No newline at end of file + sender.out -> receiver.in; +} diff --git a/test/C/src/federated/HelloDistributed.lf b/test/C/src/federated/HelloDistributed.lf index 3db8232421..4bed5060b6 100644 --- a/test/C/src/federated/HelloDistributed.lf +++ b/test/C/src/federated/HelloDistributed.lf @@ -11,7 +11,7 @@ reactor Source { reaction(startup) -> out {= lf_print("Sending 'Hello World!' message from source federate."); lf_set(out, "Hello World!"); - request_stop(); + lf_request_stop(); =} } reactor Destination { diff --git a/test/C/src/federated/PingPongDistributedPhysical.lf b/test/C/src/federated/PingPongDistributedPhysical.lf index ac503ce13c..24b590d5cb 100644 --- a/test/C/src/federated/PingPongDistributedPhysical.lf +++ b/test/C/src/federated/PingPongDistributedPhysical.lf @@ -41,7 +41,7 @@ reactor Ping(count:int(10)) { if (self->pingsLeft > 0) { lf_schedule(serve, 0); } else { - request_stop(); + lf_request_stop(); } =} } @@ -54,7 +54,7 @@ reactor Pong(expected:int(10)) { printf("At logical time %lld, Pong received %d.\n", lf_time_logical_elapsed(), receive->value); lf_set(send, receive->value); if (self->count == self->expected) { - request_stop(); + lf_request_stop(); } =} reaction(shutdown) {= diff --git a/test/C/src/federated/StopAtShutdown.lf b/test/C/src/federated/StopAtShutdown.lf index 76556e139e..558d713ee0 100644 --- a/test/C/src/federated/StopAtShutdown.lf +++ b/test/C/src/federated/StopAtShutdown.lf @@ -1,5 +1,5 @@ /** - * Check that request_stop() doesn't cause + * Check that lf_request_stop() doesn't cause * any issues at the shutdown tag. * * Original bug discovered by Steven Wong @@ -21,7 +21,7 @@ reactor A { =} reaction(shutdown) {= - request_stop(); + lf_request_stop(); =} } @@ -32,7 +32,7 @@ reactor B { lf_set(out, 1); =} reaction(shutdown) {= - request_stop(); + lf_request_stop(); =} }