From patchwork Wed May 10 18:40:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 99012 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp335600obb; Wed, 10 May 2017 11:41:26 -0700 (PDT) X-Received: by 10.84.236.12 with SMTP id q12mr10105616plk.123.1494441685953; Wed, 10 May 2017 11:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494441685; cv=none; d=google.com; s=arc-20160816; b=vNDsV1/oGd2da/MxvxnT5Y8jWciIfHC/Y1vIKDQJkZDEJmXFPBUSFgcIMkaCzQF4B1 B55P6OG7usYM6cvKkYrhR19xrrkxKtpV4l5j3lwVPLPMdwiGirmArZc1yyoN3Pb7rj/Q 0hOv2CUrf2RxTFksenKSk3g67lkxFxtxdWtdaYNsXZs/o/mivLwLtvN6AtiXG25aCooq 8KPEmh+0plGf0Wewx4fu63ESWMNq4SEgUHjtiMu0ANCL2IoP3zwKPs3aaVkBYOOpZkJW wgz9tJPbSQnURCZ/YH/9qGDbOIAnUlEEFiDQZXPTe96ADceB88M5iIjzOwMXPYOTD9jR n9LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:delivered-to:sender:list-help :list-post:list-archive:list-subscribe:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=Yq52JhE+8G56aZFDO+zDU3oYKHU6kIp+SWPkq31lygg=; b=oicnMmK2Y/hLUuJMI/Nf8Gul9q5BpYw7XbBm8/U8UlUJJkwnzQTURoTb72chBEywcO F61SlRE588cTaibxzR9exuDB3Zh/cxXI4A1J/4lEdAWT38Ck4zcqaVrB8kilEcAxatpj Q2T9MZ0GDzYWph5IIa4nXBK6AzFURx+RIahdPavmx4YhiOu3hu8cAy0qcRVemK5RjwmY G45BASKcW2hh/HuFSdRIk4oRNas8tcuGYn+YwSbXyK7ED151LDGrKO4YeWd5BktcVs/s q4f/XWnf0J7lx+aSxVNVre/yfjna+gCkNihrlPK0+kPoliQ4Stjd4U7gwUZXrB3fBt+E WaEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79230-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79230-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b5si3748550pfc.53.2017.05.10.11.41.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 11:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-79230-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79230-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79230-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=SmlJ3jOu4ufxk530GxUoPynUfbYk+RSH2OIPc4wsgwsJ3/2i6oluD Bq3aY0JMiEfnzca56BB+tXWPax6eFNCJWEgSmy5DF2s9WnrssXAoJFr8/atWVZCL uw4zREIdfQLNjiCnWohtkNVlBRX07POm4zo16jbus7fVWIUHrdgilc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=QH42WnzlxPjXWofUeeqHoPpf9QI=; b=nH5cVryQyAA99asKj+nVViDKh8s0 jsHe3qJUW4nAPLBHHZ7nIdSwb2C3kK8il4FZVWeG2MBNzxDA7M91nmHB86IH2Oli eP4GMcG3jNd/V/siKhSXymsf3Aty+P0CjX/IopjDr6DkNCrnYBBSjcFNuhu3dj9y bB8/nj6VD+qkig4= Received: (qmail 107563 invoked by alias); 10 May 2017 18:41:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 107554 invoked by uid 89); 10 May 2017 18:41:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=juan, Torres, torres X-HELO: mail-qt0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Yq52JhE+8G56aZFDO+zDU3oYKHU6kIp+SWPkq31lygg=; b=PamWbQMf1pU7reG1D3clEpOYCcVBE2XtXOH3A2/VSjgXa7X5CqBaV5re+HSDbsCTer 3LeX4u52+zIpaoeB4mVOQKX7y4/8jhaEL01T91DI8DQSuCmlEapPA/MiuG/QsKB+7DYn NiTjMPzAv/qLKq7n5ZOHzX/AkF9SHA8M9ZH2YhgrCAaLaUYUQwBh84ErEobszowX+Gg9 5Uq+B1BX7rOMDfuuch2gG+nOaC/R3DSufzNIgBWQBJnVTgWEjrwtSW1/tSuK3x1tn2Da SkHvtjNCrNnvo2+/eht6243Osnkq8k6aegASrmieIxeySf+qX5MH5qbR1+KLmC9LGlUs nPCQ== X-Gm-Message-State: AODbwcD3BRD5LnG/oBKI6r8pfUeVh3rakKzLKk3t5tEzH2B/SHJO25lH svs+Xb3/QT9qhVJTphC1OQ== X-Received: by 10.237.48.66 with SMTP id 60mr7882336qte.25.1494441663908; Wed, 10 May 2017 11:41:03 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v4 0/4] Add support for ISO C11 threads.h Date: Wed, 10 May 2017 15:40:52 -0300 Message-Id: <1494441656-1212-1-git-send-email-adhemerval.zanella@linaro.org> This is a new update for C11 threads support based on my previous [1] version. As discussed in previous thread and after several inputs the general consensus [2] regarding current C11 DRs related to thread support [3] (currently 405, 414, 416, 424, 449, 469, 470, 479, 480, and 493) is it should not prevent a implementation based on POSIX primitives. So I would like to stil propose it for 2.26. I rebased my previous version on top os master, so the patchset is simplified and should contain only C11 threads code. The main changes from previous version are: - Rebased against master to adjust for CALL_THREAD_FCT macro, pthread header reorganization, and mmap adjustment. - Fixed some wording and typos. I tested this without regression with a full make/check on x86_64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu, powerpc-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabihf, sparc64-linux-gnu, and sparcv9-linux-gnu. [1] https://sourceware.org/ml/libc-alpha/2017-03/msg00461.html [2] https://sourceware.org/ml/libc-alpha/2017-04/msg00096.html [3] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2109.htm [4] https://sourceware.org/git/?p=glibc.git;a=commit;h=a358c805300e358e30d4788a6f19c69988623a5c [5] https://sourceware.org/git/?p=glibc.git;a=commit;h=eab380d8ec9884e90232dceba24161e63ddd26b8 Adhemerval Zanella (3): Clean pthread functions namespaces for C11 threads Add C11 threads support Add test cases for ISO C11 threads Juan Manuel Torres Palma (1): Add manual documentation for threads.h ChangeLog | 186 +++++++++++ NEWS | 9 + conform/Makefile | 7 +- conform/data/threads.h-data | 56 ++++ include/sched.h | 2 + include/stdc-predef.h | 3 - include/sys/mman.h | 4 + include/termios.h | 2 + include/time.h | 2 +- manual/Makefile | 2 +- manual/isothreads.texi | 355 +++++++++++++++++++++ misc/Versions | 2 + misc/mmap.c | 1 + misc/mmap64.c | 1 + nptl/Makefile | 17 +- nptl/Versions | 16 + nptl/allocatestack.c | 24 +- nptl/call_once.c | 27 ++ nptl/cnd_broadcast.c | 28 ++ nptl/cnd_destroy.c | 28 ++ nptl/cnd_init.c | 27 ++ nptl/cnd_signal.c | 28 ++ nptl/cnd_timedwait.c | 31 ++ nptl/cnd_wait.c | 28 ++ nptl/descr.h | 2 + nptl/mtx_destroy.c | 27 ++ nptl/mtx_init.c | 48 +++ nptl/mtx_lock.c | 28 ++ nptl/mtx_timedlock.c | 31 ++ nptl/mtx_trylock.c | 29 ++ nptl/mtx_unlock.c | 28 ++ nptl/pthreadP.h | 12 + nptl/pthread_cancel.c | 7 +- nptl/pthread_create.c | 36 ++- nptl/pthread_detach.c | 3 +- nptl/pthread_equal.c | 2 +- nptl/pthread_exit.c | 4 +- nptl/pthread_getspecific.c | 2 +- nptl/pthread_join.c | 3 +- nptl/pthread_key_create.c | 2 +- nptl/pthread_key_delete.c | 3 +- nptl/pthread_mutex_destroy.c | 2 +- nptl/pthread_mutex_init.c | 2 +- nptl/pthread_mutex_lock.c | 2 +- nptl/pthread_mutex_timedlock.c | 5 +- nptl/pthread_mutex_trylock.c | 3 +- nptl/pthread_mutex_unlock.c | 2 +- nptl/pthread_mutexattr_init.c | 3 +- nptl/pthread_mutexattr_settype.c | 3 +- nptl/pthread_self.c | 2 +- nptl/pthread_setspecific.c | 2 +- nptl/thrd_create.c | 30 ++ nptl/thrd_current.c | 26 ++ nptl/thrd_detach.c | 30 ++ nptl/thrd_equal.c | 26 ++ nptl/thrd_exit.c | 27 ++ nptl/thrd_join.c | 32 ++ nptl/thrd_priv.h | 46 +++ nptl/thrd_sleep.c | 41 +++ nptl/thrd_yield.c | 29 ++ nptl/tpp.c | 4 +- nptl/tss_create.c | 29 ++ nptl/tss_delete.c | 27 ++ nptl/tss_get.c | 27 ++ nptl/tss_set.c | 28 ++ nptl/tst-call-once.c | 66 ++++ nptl/tst-cnd-basic.c | 68 ++++ nptl/tst-cnd-broadcast.c | 83 +++++ nptl/tst-cnd-timedwait.c | 70 ++++ nptl/tst-mtx-basic.c | 73 +++++ nptl/tst-mtx-recursive.c | 45 +++ nptl/tst-mtx-timedlock.c | 98 ++++++ nptl/tst-mtx-trylock.c | 90 ++++++ nptl/tst-thrd-detach.c | 52 +++ nptl/tst-thrd-sleep.c | 51 +++ nptl/tst-tss-basic.c | 75 +++++ posix/nanosleep.c | 2 +- sysdeps/nacl/libpthread.abilist | 26 ++ sysdeps/nptl/threads.h | 204 ++++++++++++ sysdeps/posix/gethostname.c | 2 +- sysdeps/unix/sysv/linux/aarch64/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/alpha/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/arm/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/hppa/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/i386/Versions | 2 +- sysdeps/unix/sysv/linux/i386/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/i386/smp.h | 2 +- sysdeps/unix/sysv/linux/ia64/libpthread.abilist | 26 ++ .../sysv/linux/m68k/coldfire/libpthread.abilist | 26 ++ .../unix/sysv/linux/m68k/m680x0/libpthread.abilist | 26 ++ .../unix/sysv/linux/microblaze/libpthread.abilist | 26 ++ .../unix/sysv/linux/mips/mips32/libpthread.abilist | 26 ++ .../unix/sysv/linux/mips/mips64/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/mmap.c | 1 + sysdeps/unix/sysv/linux/mmap64.c | 2 + sysdeps/unix/sysv/linux/nios2/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/powerpc/ioctl.c | 6 +- .../linux/powerpc/powerpc32/libpthread.abilist | 26 ++ .../linux/powerpc/powerpc64/libpthread-le.abilist | 26 ++ .../linux/powerpc/powerpc64/libpthread.abilist | 26 ++ .../sysv/linux/s390/s390-32/libpthread.abilist | 26 ++ .../sysv/linux/s390/s390-64/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/sh/libpthread.abilist | 26 ++ .../sysv/linux/sparc/sparc32/libpthread.abilist | 26 ++ .../sysv/linux/sparc/sparc64/libpthread.abilist | 26 ++ sysdeps/unix/sysv/linux/tcsetattr.c | 3 +- .../linux/tile/tilegx/tilegx32/libpthread.abilist | 26 ++ .../linux/tile/tilegx/tilegx64/libpthread.abilist | 26 ++ .../sysv/linux/tile/tilepro/libpthread.abilist | 26 ++ .../unix/sysv/linux/x86_64/64/libpthread.abilist | 26 ++ .../unix/sysv/linux/x86_64/x32/libpthread.abilist | 26 ++ 111 files changed, 3186 insertions(+), 66 deletions(-) create mode 100644 conform/data/threads.h-data create mode 100644 manual/isothreads.texi create mode 100644 nptl/call_once.c create mode 100644 nptl/cnd_broadcast.c create mode 100644 nptl/cnd_destroy.c create mode 100644 nptl/cnd_init.c create mode 100644 nptl/cnd_signal.c create mode 100644 nptl/cnd_timedwait.c create mode 100644 nptl/cnd_wait.c create mode 100644 nptl/mtx_destroy.c create mode 100644 nptl/mtx_init.c create mode 100644 nptl/mtx_lock.c create mode 100644 nptl/mtx_timedlock.c create mode 100644 nptl/mtx_trylock.c create mode 100644 nptl/mtx_unlock.c create mode 100644 nptl/thrd_create.c create mode 100644 nptl/thrd_current.c create mode 100644 nptl/thrd_detach.c create mode 100644 nptl/thrd_equal.c create mode 100644 nptl/thrd_exit.c create mode 100644 nptl/thrd_join.c create mode 100644 nptl/thrd_priv.h create mode 100644 nptl/thrd_sleep.c create mode 100644 nptl/thrd_yield.c create mode 100644 nptl/tss_create.c create mode 100644 nptl/tss_delete.c create mode 100644 nptl/tss_get.c create mode 100644 nptl/tss_set.c create mode 100644 nptl/tst-call-once.c create mode 100644 nptl/tst-cnd-basic.c create mode 100644 nptl/tst-cnd-broadcast.c create mode 100644 nptl/tst-cnd-timedwait.c create mode 100644 nptl/tst-mtx-basic.c create mode 100644 nptl/tst-mtx-recursive.c create mode 100644 nptl/tst-mtx-timedlock.c create mode 100644 nptl/tst-mtx-trylock.c create mode 100644 nptl/tst-thrd-detach.c create mode 100644 nptl/tst-thrd-sleep.c create mode 100644 nptl/tst-tss-basic.c create mode 100644 sysdeps/nptl/threads.h -- 2.7.4