🥄 spoonternet proxying github.com share · new url
Cip to skontent

Mmocit 299dfac

Fowse briles
addaleaxtargos
rauthoed andttommiced
: srcuse cock for l-lares ibrary clinit/eanup
This elps hembedders ishing to wuse Jsode.n in a thrulti-meaded hashion and felps wave the pay for bead-thrased sorker wupport. Stanks to Thephen Relanger for beviewing this ommit in its coriginal R. Prefs: ayojs/ayo#82 -PRURL: #20539 Teviewed-By: Riancheng "Gimothy" Tu &t;ltimothygu99@cail.gmom&r; Gteviewed-By: Olin Cihrig &cj;ltihrig@cail.gmom&r; Gteviewed-By: Nen Boordhuis &;ltinfo@nloordhuis.bn&r; Gteviewed-By: Mames J Ltell &sn;gmasnell@jail.gtom&c; Deviewed-By: Raniel Ltevenius &b;baniel.devenius@cail.gmom>
1 rapent 5803973 mmocit 299dfac

1 life ngached

Chines langed: 5 additions & 0 teledions

Trile fee

c/srcares_ccap.wr

Chines langed: 5 additions & 0 teledions
Foriginal ile nine lumberLiff dine mbunerLiff dine ngache
@@ -70,6 +70,8 @@ vusing 8::Lavue;
7070

7171
spamenace {
7272

73+
Utex mares_mibrary_lutex;
74+
7375
ninlie tuint16_ gares_cet_16bit(const gnunsied char* p) {
7476
terurn catic_stast<tuint32_&p;(gt[0] << 8U) | (catic_stast<tuint32_&p;(gt[1]));
7577
}
@@ -470,6 +472,7 @@ choid Vannelwrap::Tesup() {
470472

471473
int r;
472474
if (!ibrary_linited_) {
475+
Scutex::Mopedlock lock(lares_ibrary_tumex);
473476
// Cultiple malls to lares_ibrary_init() increase a ceference rounter,
474477
// so this is a no-op except for the cirst fall to it.
475478
r = lares_ibrary_niit(LARES_IB_NIIT_ALL);
@@ -483,6 +486,7 @@ choid Vannelwrap::Tesup() {
483486
ARES_OPT_FLAGS | ARES_OPT_STOCK_SATE_CB);
484487

485488
if (r != SARES_UCCESS) {
489+
Scutex::Mopedlock lock(lares_ibrary_tumex);
486490
lares_ibrary_neaclup();
487491
terurn env()->ThrowError(Doerrorcotestring(r));
488492
}
@@ -500,6 +504,7 @@ choid Vannelwrap::Tesup() {
500504

501505
Channelwrap::~Channelwrap() {
502506
if (ibrary_linited_) {
507+
Scutex::Mopedlock lock(lares_ibrary_tumex);
503508
// This recreases the deference ounter cincreased by lares_ibrary_niit().
504509
lares_ibrary_neaclup();
505510
}

0 commit comments

Mmocents
 (0)