From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 29D973858415 for ; Mon, 1 Aug 2022 07:12:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29D973858415 Received: by mail-pg1-x52a.google.com with SMTP id s206so8952416pgs.3 for ; Mon, 01 Aug 2022 00:12:45 -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=xsqaiWMLOgUNyKPUJkT1sIy/JolrgJ0i2asqyKq275U=; b=BjNa0jo56Q93efMBDTN2G8BRogvoe5oLhBCa8lS84dHpkpx2I+3Vz4Gd4kEwDVMIez d+se4Yx44xc/qKT0+VKvt/o7K9yq/ha/d0Jl+9TqIO3e2iFQ4kmCOclfXzhY3T0wX2eN rZJtPmq4yXoJ3YQf4whidQSSFJcfP22T7m9ZoxM+5MBeX7XWAlYSGSqMXz9vg4PzMYgI OFaJM7JPODyvoelM96/eNRU/nNpuTY5t+RKRSGFVXxkeQya5uRmVPqFVo93w/Y01Qwb4 /6KKiQz3+1He/1bF+iSdxtlOc1xKAc9BF71uDhjm1O5VE3XchxhMcKkZUjBnOPHUDXMq 7R0g== X-Gm-Message-State: AJIora/rmI9wtCbnMI4b7Th08VUObv266xunModgBJ1pwVXfHDL/I9uG fb6fB3XrlafKa5gJ+b5iGf7cpsAecw8qzFvI1O2Dfywp X-Google-Smtp-Source: AGRyM1uUq4Dr0RIV4vgmTuIG4TSdUAmraF/TuOVylWRlkV5vLJA/K+0bR2QNilETMen6kx0L8+Bxt9abS6ExQaHrPxk= X-Received: by 2002:a63:4042:0:b0:411:bbfe:e736 with SMTP id n63-20020a634042000000b00411bbfee736mr12387813pga.1.1659337964237; Mon, 01 Aug 2022 00:12:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?Sm/Dq2wgS3LDpGhlbWFubg==?= Date: Mon, 1 Aug 2022 09:10:07 +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.5 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 07:12:46 -0000 Hi Sebastian, You have a dead-lock, probably. I just looked at your code. You are using non-recursive mutices and I think this mutex was locked twice by the very same thread. Your code is buggy. regards, Jo=C3=ABl On Mon, Aug 1, 2022 at 8:47 AM Sebastian Huber wrote: > > Hello, > > I use the attached test program to check several POSIX functions which > use an absolute CLOCK_REALTIME timeout. I noticed that the > pthread_mutex_timedlock() with clock_settime() test cases doesn't work > (it doesn't time out when the CLOCK_REALTIME is set past the time out > time point). The test case works for the other synchronization objects, > for example semaphores (sem_timedwait()) or condition variables > (pthread_cond_timedwait()). I am not sure if this is a problem with my > understanding of the POSIX standard, my test case implementation, or the > glibc/Linux version. I use Linux 5.3.18. > > -- > 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/