From e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0 Mon Sep 17 00:00:00 2001 From: kcwu Date: Sat, 8 Apr 2006 14:21:12 +0000 Subject: reduce crash possibility due to race condition. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3331 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mbbsd/cache.c b/mbbsd/cache.c index ff8b116e..a0f1c2b0 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -736,6 +736,8 @@ getbnum(const char *bname) { register int i = 0, j, start = 0, end = SHM->Bnumber - 1; int *blist = SHM->bsorted[0]; + if(SHM->Bbusystate) + sleep(1); for (i = ((start + end) / 2);; i = (start + end) / 2) { if (!(j = strcasecmp(bname, bcache[blist[i]].brdname))) return (int)(blist[i] + 1); -- cgit v1.2.3