From 613c1f4f64c9601ae1e719dd4929e3266fdd8cfa Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 17 Jan 2003 06:02:44 +0000 Subject: [PATCH] STABLE12-viced-alloc-hosts-held-and-locked-20030114 to avoid potential race as we chain in while allocating then try to lock after returning to h_GetHost_r (cherry picked from commit cff9ae0f1036782018c818ba7176ad16e9ae202c) --- src/viced/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viced/host.c b/src/viced/host.c index 226a79461..61bf469b1 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -622,6 +622,8 @@ struct host *h_Alloc_r(r_con) /*host->hcpsfailed = 0; /* save cycles */ /* h_gethostcps(host); do this under host lock */ host->FirstClient = 0; + h_Hold_r(host); + h_Lock_r(host); h_InsertList_r(host); /* update global host List */ #if FS_STATS_DETAILED /* @@ -1064,8 +1066,6 @@ retry: } } else { host = h_Alloc_r(tcon); - h_Hold_r(host); - h_Lock_r(host); h_gethostcps_r(host,FT_ApproxTime()); if (!(host->Console&1)) { if (!identP || !interfValid) { -- 2.39.5