Skip to content

Commit 88170db

Browse files
committed
docs again
1 parent 32cc97e commit 88170db

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/shims/trace/messages.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
//! The overall structure of a traced FFI call, from the child process's POV, is
44
//! as follows:
55
//! ```
6-
//! message_tx.send(TraceRequest::StartFFI);
6+
//! message_tx.send(TraceRequest::StartFfi);
77
//! confirm_rx.recv();
88
//! raise(SIGSTOP);
99
//! /* do ffi call */
10-
//! raise(SIGUSR1);
10+
//! raise(SIGUSR1); // morally equivalent to some kind of "TraceRequest::EndFfi"
1111
//! let events = event_rx.recv();
1212
//! ```
13+
//! `TraceRequest::OverrideRetcode` can be sent at any point in the above, including
14+
//! before or after all of them.
15+
//!
16+
//! NB: sending these events out of order, skipping steps, etc. will result in
17+
//! unspecified behaviour from the supervisor process, so use the abstractions
18+
//! in `super::child` (namely `start_ffi()` and `end_ffi()`) to handle this. It is
19+
//! trivially easy to cause a deadlock or crash by messing this up!
1320
1421
/// An IPC request sent by the child process to the parent.
1522
///
@@ -36,7 +43,7 @@ pub(super) enum TraceRequest {
3643
pub(super) struct Confirmation;
3744

3845
/// The final results of an FFI trace, containing every relevant event detected
39-
/// by the tracer. Sent by the supervisor.
46+
/// by the tracer. Sent by the supervisor after receiving a `SIGUSR1` signal.
4047
///
4148
/// The sender for this channel should live on the parent process.
4249
#[derive(serde::Serialize, serde::Deserialize, Debug)]

0 commit comments

Comments
 (0)