diff --git a/examples/z_liveliness.c b/examples/z_liveliness.c index 29dc51892..4191b0496 100644 --- a/examples/z_liveliness.c +++ b/examples/z_liveliness.c @@ -57,7 +57,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } else if (c == 'd') { printf("Undeclaring liveliness token...\n"); z_drop(z_move(token)); diff --git a/examples/z_ping.c b/examples/z_ping.c index 6b82b0ace..7f213ef2d 100644 --- a/examples/z_ping.c +++ b/examples/z_ping.c @@ -57,7 +57,7 @@ int main(int argc, char** argv) { z_mutex_lock(&mutex); if (args.warmup_ms) { printf("Warming up for %dms...\n", args.warmup_ms); - zp_clock_t warmup_start = zp_clock_now(); + z_clock_t warmup_start = z_clock_now(); unsigned long elapsed_us = 0; while (elapsed_us < args.warmup_ms * 1000) { @@ -66,18 +66,18 @@ int main(int argc, char** argv) { if (s != 0) { handle_error_en(s, "z_condvar_wait"); } - elapsed_us = zp_clock_elapsed_us(&warmup_start); + elapsed_us = z_clock_elapsed_us(&warmup_start); } } unsigned long* results = malloc(sizeof(unsigned long) * args.number_of_pings); for (int i = 0; i < args.number_of_pings; i++) { - zp_clock_t measure_start = zp_clock_now(); + z_clock_t measure_start = z_clock_now(); z_publisher_put(z_loan(pub), data, args.size, NULL); int s = z_condvar_wait(&cond, &mutex); if (s != 0) { handle_error_en(s, "z_condvar_wait"); } - results[i] = zp_clock_elapsed_us(&measure_start); + results[i] = z_clock_elapsed_us(&measure_start); } for (int i = 0; i < args.number_of_pings; i++) { printf("%d bytes: seq=%d rtt=%luµs, lat=%luµs\n", args.size, i, results[i], results[i] / 2); diff --git a/examples/z_pub.c b/examples/z_pub.c index 1f0d7476b..543cba694 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -66,7 +66,7 @@ int main(int argc, char **argv) { char buf[256]; for (int idx = 0; 1; ++idx) { - zp_sleep_s(1); + z_sleep_s(1); sprintf(buf, "[%4d] %s", idx, value); printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); z_publisher_put_options_t options = z_publisher_put_options_default(); diff --git a/examples/z_pub_attachment.c b/examples/z_pub_attachment.c index 877ad93be..a24133e91 100644 --- a/examples/z_pub_attachment.c +++ b/examples/z_pub_attachment.c @@ -63,7 +63,7 @@ int main(int argc, char **argv) { char buf[256]; char buf_ind[16]; for (int idx = 0; 1; ++idx) { - zp_sleep_s(1); + z_sleep_s(1); // add some other attachment value sprintf(buf_ind, "%d", idx); diff --git a/examples/z_pub_cache.c b/examples/z_pub_cache.c index 6412ca7f1..770bf9d93 100644 --- a/examples/z_pub_cache.c +++ b/examples/z_pub_cache.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) { char buf[256]; for (int idx = 0; 1; ++idx) { - zp_sleep_s(1); + z_sleep_s(1); sprintf(buf, "[%4d] %s", idx, value); printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); z_put(z_loan(s), z_keyexpr(keyexpr), (const uint8_t *)buf, strlen(buf), NULL); diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 81856c49f..10970bf62 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -79,7 +79,7 @@ int main(int argc, char **argv) { snprintf(buf, 255, "[%4d] %s", idx, value); size_t len = strlen(buf); zc_shmbuf_set_length(&shmbuf, len); - zp_sleep_s(1); + z_sleep_s(1); printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); z_publisher_put_options_t options = z_publisher_put_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); diff --git a/examples/z_pull.c b/examples/z_pull.c index 76d66d7fa..0af23f7e2 100644 --- a/examples/z_pull.c +++ b/examples/z_pull.c @@ -60,7 +60,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } else { z_subscriber_pull(z_loan(sub)); } diff --git a/examples/z_query_sub.c b/examples/z_query_sub.c index 7c2837345..15564be7c 100644 --- a/examples/z_query_sub.c +++ b/examples/z_query_sub.c @@ -62,7 +62,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } } diff --git a/examples/z_queryable.c b/examples/z_queryable.c index 32892412b..9d6ec7702 100644 --- a/examples/z_queryable.c +++ b/examples/z_queryable.c @@ -75,7 +75,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } } diff --git a/examples/z_scout.c b/examples/z_scout.c index f0201e41a..fda8e64b0 100644 --- a/examples/z_scout.c +++ b/examples/z_scout.c @@ -88,6 +88,6 @@ int main(int argc, char **argv) { z_owned_closure_hello_t closure = z_closure(callback, drop, context); printf("Scouting...\n"); z_scout(z_move(config), z_move(closure)); - zp_sleep_s(1); + z_sleep_s(1); return 0; } \ No newline at end of file diff --git a/examples/z_sub.c b/examples/z_sub.c index 1c22432d5..867c1277e 100644 --- a/examples/z_sub.c +++ b/examples/z_sub.c @@ -67,7 +67,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } } diff --git a/examples/z_sub_attachment.c b/examples/z_sub_attachment.c index a7f2308c6..58b0afd81 100644 --- a/examples/z_sub_attachment.c +++ b/examples/z_sub_attachment.c @@ -78,7 +78,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } } diff --git a/examples/z_sub_liveliness.c b/examples/z_sub_liveliness.c index 8146c2ff4..36bf64515 100644 --- a/examples/z_sub_liveliness.c +++ b/examples/z_sub_liveliness.c @@ -70,7 +70,7 @@ int main(int argc, char **argv) { while (c != 'q') { c = getchar(); if (c == -1) { - zp_sleep_s(1); + z_sleep_s(1); } } diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 766d4be4c..0c2e24b17 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -20,8 +20,8 @@ typedef struct { volatile unsigned long count; volatile unsigned long finished_rounds; - zp_clock_t start; - zp_clock_t first_start; + z_clock_t start; + z_clock_t first_start; bool started; } z_stats_t; @@ -36,7 +36,7 @@ z_stats_t *z_stats_make() { void on_sample(const z_sample_t *sample, void *context) { z_stats_t *stats = (z_stats_t *)context; if (stats->count == 0) { - stats->start = zp_clock_now(); + stats->start = z_clock_now(); if (!stats->started) { stats->first_start = stats->start; stats->started = true; @@ -46,14 +46,14 @@ void on_sample(const z_sample_t *sample, void *context) { stats->count++; } else { stats->finished_rounds++; - printf("%f msg/s\n", 1000.0 * N / zp_clock_elapsed_ms(&stats->start)); + printf("%f msg/s\n", 1000.0 * N / z_clock_elapsed_ms(&stats->start)); stats->count = 0; } } void drop_stats(void *context) { const z_stats_t *stats = (z_stats_t *)context; const unsigned long sent_messages = N * stats->finished_rounds + stats->count; - double elapsed_s = zp_clock_elapsed_s(&stats->first_start); + double elapsed_s = z_clock_elapsed_s(&stats->first_start); printf("Stats being dropped after unsubscribing: sent %ld messages over %f seconds (%f msg/s)\n", sent_messages, elapsed_s, (double)sent_messages / elapsed_s); free(context); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 68003a0aa..16d19aa5d 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -198,6 +198,13 @@ typedef struct z_owned_bytes_map_t { uint64_t _0[2]; size_t _1[4]; } z_owned_bytes_map_t; +/** + * Clock + * Uses monotonic clock + */ +typedef struct z_clock_t { + double t; +} z_clock_t; /** * Represents a Zenoh ID. * @@ -812,6 +819,13 @@ typedef struct z_task_t { typedef struct z_task_attr_t { size_t _0; } z_task_attr_t; +/** + * Time + * Uses system clock + */ +typedef struct z_time_t { + double t; +} z_time_t; /** * The options for `zc_liveliness_declare_token` */ @@ -981,30 +995,6 @@ typedef struct ze_querying_subscriber_options_t { typedef struct ze_querying_subscriber_t { const struct ze_owned_querying_subscriber_t *_0; } ze_querying_subscriber_t; -/** - * Condvar - * - */ -typedef struct z_condvar_t { - size_t _0; -} z_condvar_t; -/** - * Mutex - * - */ -typedef struct z_mutex_t { - size_t _0; -} z_mutex_t; -/** - * Task - * - */ -typedef struct z_task_t { - size_t _0; -} z_task_t; -typedef struct z_task_attr_t { - size_t _0; -} z_task_attr_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1147,6 +1137,10 @@ ZENOHC_API struct z_bytes_t z_bytes_null(void); * Constructs a `len` bytes long view starting at `start`. */ ZENOHC_API struct z_bytes_t z_bytes_wrap(const uint8_t *start, size_t len); +ZENOHC_API uint64_t z_clock_elapsed_ms(const struct z_clock_t *time); +ZENOHC_API uint64_t z_clock_elapsed_s(const struct z_clock_t *time); +ZENOHC_API uint64_t z_clock_elapsed_us(const struct z_clock_t *time); +ZENOHC_API struct z_clock_t z_clock_now(void); /** * Closes a zenoh session. This drops and invalidates `session` for double-drop safety. * @@ -2005,6 +1999,9 @@ struct z_session_t z_session_loan(const struct z_owned_session_t *s); * Constructs a null safe-to-drop value of 'z_owned_session_t' type */ ZENOHC_API struct z_owned_session_t z_session_null(void); +ZENOHC_API int8_t z_sleep_ms(size_t time); +ZENOHC_API int8_t z_sleep_s(size_t time); +ZENOHC_API int8_t z_sleep_us(size_t time); /** * Returns ``true`` if `strs` is valid. */ @@ -2067,6 +2064,11 @@ int8_t z_task_init(struct z_task_t *task, void (*fun)(void *arg), void *arg); ZENOHC_API int8_t z_task_join(struct z_task_t *task); +ZENOHC_API uint64_t z_time_elapsed_ms(const struct z_time_t *time); +ZENOHC_API uint64_t z_time_elapsed_s(const struct z_time_t *time); +ZENOHC_API uint64_t z_time_elapsed_us(const struct z_time_t *time); +ZENOHC_API struct z_time_t z_time_now(void); +ZENOHC_API const char *z_time_now_as_str(const char *buf, size_t len); /** * Returns ``true`` if `ts` is a valid timestamp */ @@ -2589,18 +2591,3 @@ int8_t ze_undeclare_publication_cache(struct ze_owned_publication_cache_t *pub_c */ ZENOHC_API int8_t ze_undeclare_querying_subscriber(struct ze_owned_querying_subscriber_t *sub); -ZENOHC_API int8_t z_condvar_free(struct z_condvar_t *cv); -ZENOHC_API int8_t z_condvar_init(struct z_condvar_t *cv); -ZENOHC_API int8_t z_condvar_signal(struct z_condvar_t *cv); -ZENOHC_API int8_t z_condvar_wait(struct z_condvar_t *cv, struct zp_mutex_t *m); -ZENOHC_API int8_t z_mutex_free(struct z_mutex_t *m); -ZENOHC_API int8_t z_mutex_init(struct z_mutex_t *m); -ZENOHC_API int8_t z_mutex_lock(struct z_mutex_t *m); -ZENOHC_API int8_t z_mutex_try_lock(struct z_mutex_t *m); -ZENOHC_API int8_t z_mutex_unlock(struct z_mutex_t *m); -ZENOHC_API -int8_t z_task_init(struct z_task_t *task, - const struct z_task_attr_t *_attr, - void (*fun)(void *arg), - void *arg); -ZENOHC_API int8_t zp_task_join(struct z_task_t *task); diff --git a/src/platform/clock.rs b/src/platform/clock.rs index b5c17ffe0..ab5e3dab6 100644 --- a/src/platform/clock.rs +++ b/src/platform/clock.rs @@ -17,39 +17,39 @@ lazy_static! { /// Uses monotonic clock #[repr(C)] #[derive(Clone, Copy)] -pub struct zp_clock_t { +pub struct z_clock_t { t: f64, } #[no_mangle] -pub extern "C" fn zp_clock_now() -> zp_clock_t { - zp_clock_t { +pub extern "C" fn z_clock_now() -> z_clock_t { + z_clock_t { t: CLOCK_BASE.elapsed().as_secs_f64(), } } #[allow(clippy::missing_safety_doc)] -unsafe fn get_elapsed_seconds(time: *const zp_clock_t) -> f64 { +unsafe fn get_elapsed_seconds(time: *const z_clock_t) -> f64 { if time.is_null() { return 0.0; } - zp_clock_now().t - (*time).t + z_clock_now().t - (*time).t } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_clock_elapsed_s(time: *const zp_clock_t) -> u64 { +pub unsafe extern "C" fn z_clock_elapsed_s(time: *const z_clock_t) -> u64 { get_elapsed_seconds(time) as u64 } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_clock_elapsed_ms(time: *const zp_clock_t) -> u64 { +pub unsafe extern "C" fn z_clock_elapsed_ms(time: *const z_clock_t) -> u64 { (get_elapsed_seconds(time) * 1000.0) as u64 } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_clock_elapsed_us(time: *const zp_clock_t) -> u64 { +pub unsafe extern "C" fn z_clock_elapsed_us(time: *const z_clock_t) -> u64 { (get_elapsed_seconds(time) * 1000000.0) as u64 } @@ -57,13 +57,13 @@ pub unsafe extern "C" fn zp_clock_elapsed_us(time: *const zp_clock_t) -> u64 { /// Uses system clock #[repr(C)] #[derive(Clone, Copy)] -pub struct zp_time_t { +pub struct z_time_t { t: f64, } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_time_now_as_str(buf: *const c_char, len: usize) -> *const c_char { +pub unsafe extern "C" fn z_time_now_as_str(buf: *const c_char, len: usize) -> *const c_char { if len == 0 { return buf; } @@ -78,8 +78,8 @@ pub unsafe extern "C" fn zp_time_now_as_str(buf: *const c_char, len: usize) -> * } #[no_mangle] -pub extern "C" fn zp_time_now() -> zp_time_t { - zp_time_t { +pub extern "C" fn z_time_now() -> z_time_t { + z_time_t { t: SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap_or(Duration::new(0, 0)) @@ -87,27 +87,27 @@ pub extern "C" fn zp_time_now() -> zp_time_t { } } #[allow(clippy::missing_safety_doc)] -unsafe fn get_elapsed_seconds_system_clock(time: *const zp_time_t) -> f64 { +unsafe fn get_elapsed_seconds_system_clock(time: *const z_time_t) -> f64 { if time.is_null() { return 0.0; } - 0.0f64.max(zp_time_now().t - (*time).t) + 0.0f64.max(z_time_now().t - (*time).t) } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_time_elapsed_s(time: *const zp_time_t) -> u64 { +pub unsafe extern "C" fn z_time_elapsed_s(time: *const z_time_t) -> u64 { get_elapsed_seconds_system_clock(time) as u64 } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_time_elapsed_ms(time: *const zp_time_t) -> u64 { +pub unsafe extern "C" fn z_time_elapsed_ms(time: *const z_time_t) -> u64 { (get_elapsed_seconds_system_clock(time) * 1000.0) as u64 } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zp_time_elapsed_us(time: *const zp_time_t) -> u64 { +pub unsafe extern "C" fn z_time_elapsed_us(time: *const z_time_t) -> u64 { (get_elapsed_seconds_system_clock(time) * 1000000.0) as u64 } diff --git a/src/platform/sleep.rs b/src/platform/sleep.rs index 1c79ac393..b2f3e4dd7 100644 --- a/src/platform/sleep.rs +++ b/src/platform/sleep.rs @@ -1,19 +1,19 @@ use std::{thread, time}; #[no_mangle] -pub extern "C" fn zp_sleep_s(time: usize) -> i8 { +pub extern "C" fn z_sleep_s(time: usize) -> i8 { thread::sleep(time::Duration::from_secs(time as u64)); 0 } #[no_mangle] -pub extern "C" fn zp_sleep_ms(time: usize) -> i8 { +pub extern "C" fn z_sleep_ms(time: usize) -> i8 { thread::sleep(time::Duration::from_millis(time as u64)); 0 } #[no_mangle] -pub extern "C" fn zp_sleep_us(time: usize) -> i8 { +pub extern "C" fn z_sleep_us(time: usize) -> i8 { thread::sleep(time::Duration::from_micros(time as u64)); 0 } diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 5233314a2..a113e2b5c 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -127,7 +127,7 @@ int main(int argc, char **argv) { assert(_ret_int == -1); #endif - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); size_t keyexpr_len = strlen(URI); char *keyexpr_str = (char *)malloc(keyexpr_len + 1); @@ -149,7 +149,7 @@ int main(int argc, char **argv) { assert(strlen(URI) == keyexpr_len); #endif - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); z_owned_config_t _ret_config = z_config_new(); assert(z_check(_ret_config)); @@ -176,7 +176,7 @@ int main(int argc, char **argv) { #endif z_drop(z_move(_ret_sconfig)); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); _ret_sconfig = z_scouting_config_from(z_loan(_ret_config)); z_owned_closure_hello_t _ret_closure_hello = z_closure(hello_handler, NULL, NULL); @@ -184,8 +184,8 @@ int main(int argc, char **argv) { assert(_ret_int8 == 0); assert(hellos == 1); - zp_sleep_s(atoi(SCOUTING_TIMEOUT) / 1000); - zp_sleep_s(SLEEP); + z_sleep_s(atoi(SCOUTING_TIMEOUT) / 1000); + z_sleep_s(SLEEP); z_owned_session_t s1 = z_open(z_move(_ret_config)); assert(z_check(s1)); @@ -199,13 +199,13 @@ int main(int argc, char **argv) { z_owned_closure_zid_t _ret_closure_zid = z_closure(zid_handler, NULL, NULL); _ret_int8 = z_info_peers_zid(z_loan(s1), z_move(_ret_closure_zid)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(zids == 0); _ret_int8 = z_info_routers_zid(z_loan(s1), z_move(_ret_closure_zid)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(zids == 1); #ifdef ZENOH_PICO @@ -215,7 +215,7 @@ int main(int argc, char **argv) { zp_start_lease_task(z_loan(s1), &_ret_lease_opt); #endif - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); _ret_config = z_config_default(); #ifdef ZENOH_PICO @@ -240,7 +240,7 @@ int main(int argc, char **argv) { zp_start_lease_task(z_loan(s2), NULL); #endif - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); z_session_t ls1 = z_loan(s1); z_owned_closure_sample_t _ret_closure_sample = z_closure(data_handler, NULL, &ls1); @@ -249,7 +249,7 @@ int main(int argc, char **argv) { z_declare_subscriber(z_loan(s2), z_keyexpr(keyexpr_str), z_move(_ret_closure_sample), &_ret_sub_opt); assert(z_check(_ret_sub)); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); char s1_res[64]; sprintf(s1_res, "%s/chunk/%d", keyexpr_str, 1); @@ -263,14 +263,14 @@ int main(int argc, char **argv) { _ret_int8 = z_put(z_loan(s1), z_loan(_ret_expr), (const uint8_t *)value, strlen(value), &_ret_put_opt); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(datas == 1); z_delete_options_t _ret_delete_opt = z_delete_options_default(); _ret_int8 = z_delete(z_loan(s1), z_loan(_ret_expr), &_ret_delete_opt); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(datas == 2); _ret_int8 = z_undeclare_keyexpr(z_loan(s1), z_move(_ret_expr)); @@ -295,23 +295,23 @@ int main(int argc, char **argv) { _ret_int8 = z_publisher_put(z_loan(_ret_pub), (const uint8_t *)value, strlen(value), &_ret_pput_opt); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); _ret_int8 = z_subscriber_pull(z_loan(_ret_psub)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(datas == 3); z_publisher_delete_options_t _ret_pdelete_opt = z_publisher_delete_options_default(); _ret_int8 = z_publisher_delete(z_loan(_ret_pub), &_ret_pdelete_opt); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); _ret_int8 = z_subscriber_pull(z_loan(_ret_psub)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(datas == 4); _ret_int8 = z_undeclare_publisher(z_move(_ret_pub)); @@ -320,7 +320,7 @@ int main(int argc, char **argv) { _ret_int8 = z_undeclare_pull_subscriber(z_move(_ret_psub)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); z_owned_closure_query_t _ret_closure_query = z_closure(query_handler, NULL, &ls1); z_queryable_options_t _ret_qle_opt = z_queryable_options_default(); @@ -328,7 +328,7 @@ int main(int argc, char **argv) { z_declare_queryable(z_loan(s1), z_keyexpr(s1_res), z_move(_ret_closure_query), &_ret_qle_opt); assert(z_check(qle)); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); z_session_t ls2 = z_loan(s2); z_owned_closure_reply_t _ret_closure_reply = z_closure(reply_handler, NULL, &ls2); @@ -342,7 +342,7 @@ int main(int argc, char **argv) { _ret_int8 = z_get(z_loan(s2), z_keyexpr(s1_res), "", z_move(_ret_closure_reply), &_ret_get_opt); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP); + z_sleep_s(SLEEP); assert(queries == 1); assert(replies == 1); @@ -364,7 +364,7 @@ int main(int argc, char **argv) { _ret_int8 = z_close(z_move(s2)); assert(_ret_int8 == 0); - zp_sleep_s(SLEEP * 5); + z_sleep_s(SLEEP * 5); free(keyexpr_str); diff --git a/tests/z_int_pub_cache_query_sub_test.c b/tests/z_int_pub_cache_query_sub_test.c index 980d5d5d8..82c27b97f 100644 --- a/tests/z_int_pub_cache_query_sub_test.c +++ b/tests/z_int_pub_cache_query_sub_test.c @@ -122,7 +122,7 @@ int run_subscriber() { } SEM_POST(sem_sub); - zp_sleep_s(10); + z_sleep_s(10); z_drop(z_move(sub)); z_close(z_move(s)); diff --git a/tests/z_int_pub_sub_attachment_test.c b/tests/z_int_pub_sub_attachment_test.c index 155fc6902..c7f502a59 100644 --- a/tests/z_int_pub_sub_attachment_test.c +++ b/tests/z_int_pub_sub_attachment_test.c @@ -106,7 +106,7 @@ int run_subscriber() { } SEM_POST(sem); - zp_sleep_s(10); + z_sleep_s(10); z_undeclare_subscriber(z_move(sub)); z_close(z_move(s)); diff --git a/tests/z_int_queryable_attachment_test.c b/tests/z_int_queryable_attachment_test.c index c33d66191..ce1ac9f42 100644 --- a/tests/z_int_queryable_attachment_test.c +++ b/tests/z_int_queryable_attachment_test.c @@ -76,7 +76,7 @@ int run_queryable() { } SEM_POST(sem); - zp_sleep_s(10); + z_sleep_s(10); z_drop(z_move(qable)); z_close(z_move(s)); diff --git a/tests/z_int_queryable_test.c b/tests/z_int_queryable_test.c index d9cc4ea92..2999451c4 100644 --- a/tests/z_int_queryable_test.c +++ b/tests/z_int_queryable_test.c @@ -59,7 +59,7 @@ int run_queryable() { } SEM_POST(sem); - zp_sleep_s(10); + z_sleep_s(10); z_drop(z_move(qable)); z_close(z_move(s));