summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-04-08 22:21:12 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-04-08 22:21:12 +0800
commite4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0 (patch)
tree591e9fb4850d5f6866da1261a8cbe5b74d4a50d8
parent7193da7e165943fa1178ab10a1a604cb0b50d0e6 (diff)
downloadpttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar.gz
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar.bz2
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar.lz
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar.xz
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.tar.zst
pttbbs-e4feaf4ac8cdbf1b3f8045ad9d2f8a4e7b154ca0.zip
reduce crash possibility due to race condition.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3331 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/cache.c2
1 files changed, 2 insertions, 0 deletions
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);