From 51432df0055359fec4e165f30c3e3022b26c0b1d Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 10 Apr 2023 17:11:17 +0800 Subject: [PATCH] add some comments Signed-off-by: fufesou --- src/client.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/client.rs b/src/client.rs index 4b06074eb..f39110a78 100644 --- a/src/client.rs +++ b/src/client.rs @@ -641,6 +641,11 @@ impl Client { TEXT_CLIPBOARD_STATE.lock().unwrap().running = false; } + // `try_start_clipboard` is called by all session when connection is established. (When handling peer info). + // This function only create one thread with a loop, the loop is shared by all sessions. + // After all sessions are end, the loop exists. + // + // If clipboard update is detected, the text will be sent to all sessions by `send_text_clipboard_msg`. #[cfg(not(any(target_os = "android", target_os = "ios")))] fn try_start_clipboard(_ctx: Option) { let mut clipboard_lock = TEXT_CLIPBOARD_STATE.lock().unwrap();