Skip to content

Commit

Permalink
Replace getchar with sleep in z_pong example
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Mar 21, 2024
1 parent 2ab6dc0 commit f8ecc57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/z_pong.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ int main(int argc, char** argv) {
z_owned_publisher_t pub = z_declare_publisher(z_loan(session), pong, NULL);
z_owned_closure_sample_t respond = z_closure(callback, drop, (void*)z_move(pub));
z_owned_subscriber_t sub = z_declare_subscriber(z_loan(session), ping, z_move(respond), NULL);
while (getchar() != 'q') {
while (1) {
z_sleep_s(1);
}
z_drop(z_move(sub));
z_close(z_move(session));
Expand Down

0 comments on commit f8ecc57

Please sign in to comment.