diff src/lock.c @ 167:7ba337dafb2c noffle

[svn] * TODO,content.c,lock.c,server.c,server.h: Remove bug notice re: need to do a Cont_write on Lock_closeDatabases in case of unwritten content changes when releasing the lock. Update content to keep dirty flag and avoid unnecessary writes, and lock to signal server to re-read its group content info after the lock is released. Do NOT write content info on Lock_close if dirty, as the placeholder article in unsubscribed groups is currently done by adding it to the content when joining the group and deliberately not saving it unless another content modification takes place and thus causes the content to be saved.
author bears
date Sun, 25 Feb 2001 23:29:50 +0000
parents 8ea6b5ddc5a5
children c912e8288164
line wrap: on
line diff
--- a/src/lock.c	Sat Jan 27 09:57:13 2001 +0000
+++ b/src/lock.c	Sun Feb 25 23:29:50 2001 +0000
@@ -1,7 +1,7 @@
 /*
   lock.c
 
-  $Id: lock.c 249 2001-01-25 13:38:31Z bears $
+  $Id: lock.c 260 2001-02-25 23:29:50Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -30,11 +30,13 @@
 
 #include <unistd.h>
 #include "configfile.h"
+#include "content.h"
 #include "log.h"
 #include "database.h"
 #include "group.h"
 #include "request.h"
 #include "portable.h"
+#include "server.h"
 #include "util.h"
 
 struct Lock
@@ -47,8 +49,8 @@
     volatile Bool lazyLockBusy;
 };
 
-static struct Lock globalLock = { "global", -1, "", TRUE };
-static struct Lock fetchLock = { "fetch", -1, "", FALSE };
+static struct Lock globalLock = { "global", -1, "", TRUE, FALSE, FALSE };
+static struct Lock fetchLock = { "fetch", -1, "", FALSE, FALSE, FALSE };
 
 static sig_t oldHandler = NULL;
 
@@ -220,6 +222,7 @@
     Grp_close();
     Db_close();
     Req_close();
+    Server_flushCache();
     releaseLock( &globalLock );
     globalLock.lazyLockBusy = FALSE;
     globalLock.lazyClose = FALSE;