From cd4af722552c4606f8350596c4c56284800763ec Mon Sep 17 00:00:00 2001 From: ptt Date: Sat, 25 May 2002 16:34:35 +0000 Subject: ofix dead lock git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@231 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/board.c | 6 +++--- mbbsd/cache.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mbbsd/board.c b/mbbsd/board.c index 910322d8..5288fedb 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.21 2002/05/25 09:33:22 ptt Exp $ */ +/* $Id: board.c,v 1.22 2002/05/25 16:34:35 ptt Exp $ */ #include #include #include @@ -694,9 +694,9 @@ void setutmpbid(int bid) userinfo_t *u; if(id) { - if (brdshm->busystate!=1 && brdshm->busystate_b[id-1]!=1) + if (brdshm->busystate!=1 && now-brdshm->busystate_b[id-1]>=10) { - brdshm->busystate_b[id-1]=1; + brdshm->busystate_b[id-1]=now; u=bcache[id-1].u; if(u!=(void*)currutmp) { diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 81cc01b0..4dcb271d 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -1,4 +1,4 @@ -/* $Id: cache.c,v 1.28 2002/05/24 18:34:22 ptt Exp $ */ +/* $Id: cache.c,v 1.29 2002/05/25 16:34:35 ptt Exp $ */ #include #include #include @@ -580,9 +580,9 @@ void load_fileheader_cache(int bid, char *direct) { int num=getbtotal(bid); int n = num-DIRCACHESIZE+1; - if (brdshm->busystate!=1 && brdshm->busystate_b[bid-1]!=1) + if (brdshm->busystate!=1 && now-brdshm->busystate_b[bid-1]>=10 ) { - brdshm->busystate_b[bid-1] = 1; + brdshm->busystate_b[bid-1] = now; get_records(direct, brdshm->dircache[bid - 1] , sizeof(fileheader_t),n<1?1:n, DIRCACHESIZE); brdshm->busystate_b[bid-1] = 0; @@ -698,10 +698,10 @@ void reset_board(int bid) { /* Ptt: if(--bid < 0) return; - if(brdshm->busystate || brdshm->busystate_b[bid-1]) { + if(brdshm->busystate || now-brdshm->busystate_b[bid-1]<10 ) { safe_sleep(1); } else { - brdshm->busystate_b[bid-1] = 1; + brdshm->busystate_b[bid-1] = now; nuser = bcache[bid-1].nuser; u = bcache[bid-1].u; -- cgit v1.2.3