diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-26 00:34:35 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2002-05-26 00:34:35 +0800 |
commit | cd4af722552c4606f8350596c4c56284800763ec (patch) | |
tree | 57ec99123ec6be0aa762206c2d7742378733036b /mbbsd/cache.c | |
parent | 07d2ee13b16efdcf710ca7a3a675eb9518b1e319 (diff) | |
download | pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar.gz pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar.bz2 pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar.lz pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar.xz pttbbs-cd4af722552c4606f8350596c4c56284800763ec.tar.zst pttbbs-cd4af722552c4606f8350596c4c56284800763ec.zip |
ofix dead lock
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@231 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/cache.c')
-rw-r--r-- | mbbsd/cache.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 <stdio.h> #include <stdlib.h> #include <string.h> @@ -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: 這樣就不用老是touch board了 */ 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; |