diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 154b033a2..0264f8d8f 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -4149,7 +4149,7 @@ ZENOHC_API void z_task_drop(struct z_moved_task_t *this_); ZENOHC_API z_result_t z_task_init(struct z_owned_task_t *this_, const struct z_task_attr_t *_attr, - void (*fun)(void *arg), + void *(*fun)(void *arg), void *arg); /** * Joins the task and releases all allocated resources diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index d01904133..9ae338d41 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -242,7 +242,7 @@ pub extern "C" fn z_internal_task_check(this_: &z_owned_task_t) -> bool { } struct FunArgPair { - fun: unsafe extern "C" fn(arg: *mut c_void), + fun: unsafe extern "C" fn(arg: *mut c_void) -> *mut c_void, arg: *mut c_void, } @@ -265,7 +265,7 @@ unsafe impl Send for FunArgPair {} pub unsafe extern "C" fn z_task_init( this: &mut MaybeUninit, _attr: *const z_task_attr_t, - fun: unsafe extern "C" fn(arg: *mut c_void), + fun: unsafe extern "C" fn(arg: *mut c_void) -> *mut c_void, arg: *mut c_void, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit();