Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sleep and time primitives (similar to zenoh-pico) #256

Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 88 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ maintenance = { status = "actively-developed" }
[dependencies]
async-std = "=1.12.0"
async-trait = "0.1.66"
chrono = "0.4.34"
env_logger = "0.10.0"
futures = "0.3.26"
json5 = "0.4.1"
lazy_static = "1.4.0"
libc = "0.2.139"
log = "0.4.17"
rand = "0.8.5"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ maintenance = { status = "actively-developed" }
[dependencies]
async-std = "=1.12.0"
async-trait = "0.1.66"
chrono = "0.4.34"
env_logger = "0.10.0"
futures = "0.3.26"
json5 = "0.4.1"
lazy_static = "1.4.0"
libc = "0.2.139"
log = "0.4.17"
rand = "0.8.5"
Expand Down
8 changes: 1 addition & 7 deletions examples/z_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@

#include <stdio.h>
#include <string.h>
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#define sleep(x) Sleep(x * 1000)
#else
#include <unistd.h>
#endif
#include "zenoh.h"

int main(int argc, char **argv) {
Expand Down Expand Up @@ -63,7 +57,7 @@ int main(int argc, char **argv) {
while (c != 'q') {
c = getchar();
if (c == -1) {
sleep(1);
z_sleep_s(1);
} else if (c == 'd') {
printf("Undeclaring liveliness token...\n");
z_drop(z_move(token));
Expand Down
Loading
Loading