mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
xous: document disconnect
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
7c2d3a2247
commit
091a655a0a
1 changed files with 11 additions and 0 deletions
|
|
@ -1574,6 +1574,9 @@ pub fn destroy_server(sid: SID) -> core::result::Result<(), Error> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Disconnect the specified connection ID and mark it as free. This
|
||||
/// connection ID may be reused by the server in the future, so ensure
|
||||
/// no other threads are using the connection ID before disposing of it.
|
||||
pub unsafe fn disconnect(cid: CID) -> core::result::Result<(), Error> {
|
||||
rsyscall(SysCall::Disconnect(cid)).and_then(|result| {
|
||||
if let Result::Ok = result {
|
||||
|
|
@ -1584,10 +1587,18 @@ pub unsafe fn disconnect(cid: CID) -> core::result::Result<(), Error> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Block the current thread and wait for the specified thread to
|
||||
/// return. Returns the return value of the thread.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * **ThreadNotAvailable**: The thread could not be found, or was not sleeping.
|
||||
pub fn join_thread(tid: TID) -> core::result::Result<usize, Error> {
|
||||
rsyscall(SysCall::JoinThread(tid)).and_then(|result| {
|
||||
if let Result::Scalar1(val) = result {
|
||||
Ok(val)
|
||||
} else if let Result::Error(Error::ThreadNotAvailable) = result {
|
||||
Err(Error::ThreadNotAvailable)
|
||||
} else {
|
||||
Err(Error::InternalError)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue