Revert "bsnmpclient(3): make it thread-safe"
This reverts commit 89e3d5671b
.
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
This commit is contained in:
parent
916806472a
commit
f53120073b
@ -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));
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user