Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1103355rdb; Wed, 6 Dec 2023 08:39:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmE1kmkrK2ACzvddnwuowqAPAp3T0w1THDAb9E6kHsmr16XRGc4378zGwwFeMGT10rjNTs X-Received: by 2002:a05:6a00:98e:b0:6ce:6420:e174 with SMTP id u14-20020a056a00098e00b006ce6420e174mr1410710pfg.36.1701880755539; Wed, 06 Dec 2023 08:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701880755; cv=none; d=google.com; s=arc-20160816; b=0OYlGE8tWQgFNJJRYDOBkjYs3Z7AX+GA/s5EeLkAAkgtZ4FeCdANA4/QR43OT8wXzQ /30ef1z8SrsMd7j8MuF7HMvarDqoVHiT5MjEC4L845tIZG5gU8ZrGZ1+f6osWZ1Rwq0K 25F/99GE9/F4KXs9e8isGp9Fq2uy1zOJw/bGvBQj5sPdU8xZT3XsUVwFJUd6zJ5+YQ+I YbY7FmXSNcZNpJJetQnDazHgUchj2IHO0b0tSEpYGQ2g3suOU+uBYMkMvrQC43cNmW4q 2Kt+eNhWGQ3m5XkB214BG0j4Rfm8MMls4ImuZgnSwW4wNkLhqWbov9QWkK3QP4SwWP8p Nlpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JbcOYch65HQgwW4bXeNQNStE/Bld2otdL+K6EjO7ssY=; fh=XQfrCno1CU8t79efTVbraVFdOcmwpJHIWUf+GbUbMXU=; b=XeTZyW7kESPF+BqNBEvV03DN8onHptggaGyKUtIpif5p2Pgt9qACUVf1PvjOmlobB1 uyZGnp4BS2TN2XJwFDw0kP0VvZGwzeFSPYx+7GehCnoYSftIQvkA/GW7bcUtAAmkjsUQ oGJUbEhLSgJnGnRcOLOKF49nNrXs5MSLGCrv7wIy9SDWT252ZH5MnOWLMeQ3V+GqzQjx oqzSgHDA6lpgjw4rGGad6sLeR6TeegTyy2miG9mC6Wh4XD7cQFQ7ZsAiZTIF4BpUWnC2 kovseiATFldPpV+ZVtN6GTBnIWzOmyWeLRDSwbQVKjewhEVHWwrFhvtz+tsQRO12KADx /ucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PmEKKJUI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h8-20020a056a00170800b006ce387bc2fesi190578pfc.260.2023.12.06.08.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:39:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PmEKKJUI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 23A418028A62; Wed, 6 Dec 2023 08:39:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442586AbjLFQiz (ORCPT + 99 others); Wed, 6 Dec 2023 11:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379366AbjLFQix (ORCPT ); Wed, 6 Dec 2023 11:38:53 -0500 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7782FA for ; Wed, 6 Dec 2023 08:38:59 -0800 (PST) Received: by mail-ua1-x933.google.com with SMTP id a1e0cc1a2514c-7c461a8cb0dso1473295241.0 for ; Wed, 06 Dec 2023 08:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701880739; x=1702485539; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=JbcOYch65HQgwW4bXeNQNStE/Bld2otdL+K6EjO7ssY=; b=PmEKKJUIVcUp9Gxuf3aFfdxZyOViqVpHsUBLh/iW827KBOcUMfNFsu02LTOFjHOZWh GhSiWdukxLCDFabebhw+pYRkab2cJTcg98+oHdmaIRmGxvsOH5CFUXDCvbOqBhsG0zPv u2v6m3s4XX06toKFB1JeNiFtaN8IXDGTKVTOB3kPAqwOfw++t3kSECOWQdii6+VZwZEn tYuv2P+lhTmBUeuyuv6zdlYa0Fk0xIB9hzEc2UGwuI4y0mhm3TKDWLdHhGtd5DpC+Hss Jp+H8DdnblZ8IZdZ0Xkf9DUb7AdebwV5QLjNwNjclHa4BwLGIPsnl6DJAtEBl4HHGnqH R0mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701880739; x=1702485539; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JbcOYch65HQgwW4bXeNQNStE/Bld2otdL+K6EjO7ssY=; b=vZur8GA4VyoTh+NSy6aMUcSaOgvvndITiOTvAAjYMcp0P8jx5HAuAJJMGJZAxKOczo OazFui5xRxWJW2jSXyrK/kMVWJeBK3DB0VOMaoRjNKP0cODetrqQb3CICb/qN1zel73T R8UMY+sH3OXhMnZw4SmDpJ49g1BaDYAyloIKqjJymNo8jckzS762yMtx9R1QDm+4Iet8 DSdX9fZtdOm1fNVt3HeyZ8m7QibVZPkCNELrbsA2+fTMeYXzRXgU0lnfGuzMkCitdxua UJdKN8ND8Y7teN1Pj0fIrUFuwiJK5gdRFXJOhGiaHyu5YALY9j+Afhep+7y/qbeCY/O8 LnUw== X-Gm-Message-State: AOJu0YxXrZe7m0G5AkqvMgdwNchWD0+tppFfnSR5rU+CFsD1C7OOWlm6 R1sdac1zau1ewvoksIkt0N/pf5tVCMNxdrgZMH5ILMzkAy/xPGi1hxXw70uB X-Received: by 2002:a1f:c604:0:b0:4b2:b4a1:593f with SMTP id w4-20020a1fc604000000b004b2b4a1593fmr599469vkf.12.1701880738877; Wed, 06 Dec 2023 08:38:58 -0800 (PST) MIME-Version: 1.0 References: <20231206-rb-new-condvar-methods-v1-0-33a4cab7fdaa@google.com> <20231206-rb-new-condvar-methods-v1-2-33a4cab7fdaa@google.com> <096b7406-b57c-4daa-9a12-38338dbd91ef@gmail.com> In-Reply-To: <096b7406-b57c-4daa-9a12-38338dbd91ef@gmail.com> From: Alice Ryhl Date: Wed, 6 Dec 2023 17:38:45 +0100 Message-ID: Subject: Re: [PATCH 2/2] rust: sync: add `CondVar::wait_timeout` To: Martin Rodriguez Reboredo Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 06 Dec 2023 08:39:13 -0800 (PST) On Wed, Dec 6, 2023 at 4:53=E2=80=AFPM Martin Rodriguez Reboredo wrote: > > On 12/6/23 07:09, Alice Ryhl wrote: > > Sleep on a condition variable with a timeout. > > > > This is used by Rust Binder for process freezing. There, we want to > > sleep until the freeze operation completes, but we want to be able to > > abort the process freezing if it doesn't complete within some timeout. > > > > Signed-off-by: Alice Ryhl > > --- > > [...] > > > > + /// Atomically releases the given lock (whose ownership is proven = by the guard) and puts the > > + /// thread to sleep. It wakes up when notified by [`CondVar::notif= y_one`] or > > + /// [`CondVar::notify_all`], or when the thread receives a signal. > > + /// > > + /// Returns whether there is a signal pending. > > Remaining jiffies or zero on timeout? Seems like I just copied this typo from the other `_internal` method. I'll fix it on both. Alice