support starting and stopping tasks

This commit is contained in:
Dustin J. Mitchell
2022-01-31 00:04:58 +00:00
parent d24319179c
commit 8bd9605b25
4 changed files with 136 additions and 33 deletions

View File

@@ -251,8 +251,8 @@ pub extern "C" fn tc_replica_error<'a>(rep: *mut TCReplica) -> *mut TCString<'st
#[no_mangle]
pub extern "C" fn tc_replica_free(rep: *mut TCReplica) {
// SAFETY:
// - rep is not NULL
// - caller will not use the TCReplica after this
// - rep is not NULL (promised by caller)
// - caller will not use the TCReplica after this (promised by caller)
let replica = unsafe { TCReplica::from_arg(rep) };
if replica.mut_borrowed {
panic!("replica is borrowed and cannot be freed");