From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by sourceware.org (Postfix) with ESMTPS id 42B3B3846078 for ; Tue, 6 Apr 2021 13:09:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 42B3B3846078 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FF79K6Hdcz19KtW; Tue, 6 Apr 2021 21:07:33 +0800 (CST) Received: from huawei.com (10.174.177.68) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 21:09:34 +0800 From: y00575850 To: CC: , Subject: sem_timedwait: The semaphore times out when the clock_REALTIME is used. Date: Tue, 6 Apr 2021 21:09:33 +0800 Message-ID: <20210406130933.1915-1-yangyanchao6@huawei.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.174.177.68] X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Apr 2021 13:09:49 -0000 Dear Carlos, When I use sem_timedwait, a time jump will cause the semaphore to time out. While I know that using CLOCK_REALTIME is POSIX-defined behavior, it doesn't fit the actual meaning of this function.To solve this problem, modify the sem_timedwait process, for example: add a switch control. Or add an interface that uses the Clock_MONOTONIC interface. Best regards, Yanchao