From owner-dev-commits-src-main@freebsd.org Tue Dec 29 19:59:17 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BBFA4C98E2; Tue, 29 Dec 2020 19:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D54xd0Cnwz3KnF; Tue, 29 Dec 2020 19:59:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E9F0E11CB3; Tue, 29 Dec 2020 19:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BTJxGr4061039; Tue, 29 Dec 2020 19:59:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BTJxGFh061037; Tue, 29 Dec 2020 19:59:16 GMT (envelope-from git) Date: Tue, 29 Dec 2020 19:59:16 GMT Message-Id: <202012291959.0BTJxGFh061037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: f53120073b32 - main - Revert "bsnmpclient(3): make it thread-safe" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f53120073b321c1d2e42641ca22414992ddbe0ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 19:59:17 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=f53120073b321c1d2e42641ca22414992ddbe0ff commit f53120073b321c1d2e42641ca22414992ddbe0ff Author: Edward Tomasz Napierala AuthorDate: 2020-12-29 19:55:05 +0000 Commit: Edward Tomasz Napierala CommitDate: 2020-12-29 19:55:05 +0000 Revert "bsnmpclient(3): make it thread-safe" This reverts commit 89e3d5671ba13dceca272d5b159c9bd805f3f504. As pointed out, there are several problems with that commit: 1. The new semantics, while useful for clients where multiple threads use separate contexts, breaks clients which correctly share a single one 2. Change in semantics would require a library version bump 3. It doesn't build with GCC --- contrib/bsnmp/lib/asn1.c | 2 +- contrib/bsnmp/lib/snmpclient.c | 4 ++-- contrib/bsnmp/lib/snmpclient.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/bsnmp/lib/asn1.c b/contrib/bsnmp/lib/asn1.c index a03dac70c529..f1f9267c0226 100644 --- a/contrib/bsnmp/lib/asn1.c +++ b/contrib/bsnmp/lib/asn1.c @@ -1019,7 +1019,7 @@ asn_oid2str_r(const struct asn_oid *oid, char *buf) char * asn_oid2str(const struct asn_oid *oid) { - __thread static char str[ASN_OIDSTRLEN]; + static char str[ASN_OIDSTRLEN]; return (asn_oid2str_r(oid, str)); } diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c index e49105918416..c22d8e125a14 100644 --- a/contrib/bsnmp/lib/snmpclient.c +++ b/contrib/bsnmp/lib/snmpclient.c @@ -71,7 +71,7 @@ #define DEBUG_PARSE 0 /* global context */ -__thread struct snmp_client snmp_client; +struct snmp_client snmp_client; /* List of all outstanding requests */ struct sent_pdu { @@ -86,7 +86,7 @@ struct sent_pdu { }; LIST_HEAD(sent_pdu_list, sent_pdu); -__thread static struct sent_pdu_list sent_pdus; +static struct sent_pdu_list sent_pdus; /* * Prototype table entry. All C-structure produced by the table function must diff --git a/contrib/bsnmp/lib/snmpclient.h b/contrib/bsnmp/lib/snmpclient.h index 1bc3780de038..a19bdb2ea653 100644 --- a/contrib/bsnmp/lib/snmpclient.h +++ b/contrib/bsnmp/lib/snmpclient.h @@ -114,7 +114,7 @@ struct snmp_client { }; /* the global context */ -extern __thread struct snmp_client snmp_client; +extern struct snmp_client snmp_client; /* initizialies a snmp_client structure */ void snmp_client_init(struct snmp_client *);