From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id E60EC3858D39 for ; Mon, 1 Aug 2022 09:54:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E60EC3858D39 Received: by mail-pf1-x42b.google.com with SMTP id f192so674768pfa.9 for ; Mon, 01 Aug 2022 02:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sOcx5v1FJsd2MZkzMk8MsODs9DkWmeA6MMQXfxtgZQI=; b=3rOpJbFs0o7hSs2DcIndLE2PQQxZETsB5Q7kqSYNZ48bdfxrGMM/jWhEAFfW1hk+JJ uf9KPYmUvSlOu2XncUNg7Ka4PynTAMO6JoJMf3O17H9mHylkwMMkz394Z/HoxfKNmb5Z W47nuRPkmyJE02nyhp8rW1NAx1Raci+IUtsIbtaxg6q8LbO21t0n48j0rjykdnJHRPYc DkoD6asI90VN1hi7uaFN+0gIS3/pEWHQ7XDsX6nt7TADq/OFAyrnMWk6eSaWU1AdlK+U QZh4fqB67BWxAzY52LoMg1nxtdVEttwcuZd7cAUrBdwr1RMcmDxb0yVY758mL5F7w26v se/Q== X-Gm-Message-State: AJIora/F2YI3PSMwgAEuhpd1kdQcWiOdf1mbFctvBWew2NT684vC3ixE FdxO3ztCrpjAKTdDXaJ9Z8eUirWsaK9bvU8MXMKAdanN X-Google-Smtp-Source: AGRyM1tVUp5tqhuxjIdRNFSEkflNQdAm5hO/Im/gqSOChWUH3ezH816vwSS53TIaGt9d/UMuZHg0dzwyy4gsOce21O0= X-Received: by 2002:a05:6a00:a08:b0:52b:fd6e:b198 with SMTP id p8-20020a056a000a0800b0052bfd6eb198mr15644154pfh.53.1659347644783; Mon, 01 Aug 2022 02:54:04 -0700 (PDT) MIME-Version: 1.0 References: <9f29c0c4-7b2a-3d95-5a62-837b5c352d79@embedded-brains.de> In-Reply-To: <9f29c0c4-7b2a-3d95-5a62-837b5c352d79@embedded-brains.de> From: =?UTF-8?B?Sm/Dq2wgS3LDpGhlbWFubg==?= Date: Mon, 1 Aug 2022 11:51:27 +0200 Message-ID: Subject: Re: pthread_mutex_timedlock() vs. clock_settime() To: Sebastian Huber Cc: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2022 09:54:07 -0000 Hi, Sorry, you are right. Might be your conditional lock is buggy. I think of a race-condition ending in a dead-lock, because you don't do any initial sync. ^^ this is really probable, but let me check later. regards, Jo=C3=ABl On Mon, Aug 1, 2022 at 10:36 AM Sebastian Huber wrote: > > On 01/08/2022 10:28, Jo=C3=ABl Kr=C3=A4hemann wrote: > > pthread_mutex_t mtx of struct test_context. > > > > You lock it in line 503 first, then you call test_timeout_finite(), > > which calls event_post() in run() second lock. > > the event_post() and event_get() use their own data structures with > dedicated mutexes and condition variables: > > typedef struct { > int value; > pthread_mutex_t mtx; > pthread_cond_t cnd; > } event; > > -- > embedded brains GmbH > Herr Sebastian HUBER > Dornierstr. 4 > 82178 Puchheim > Germany > email: sebastian.huber@embedded-brains.de > phone: +49-89-18 94 741 - 16 > fax: +49-89-18 94 741 - 08 > > Registergericht: Amtsgericht M=C3=BCnchen > Registernummer: HRB 157899 > Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler > Unsere Datenschutzerkl=C3=A4rung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/