comparison src/lock.c @ 183:c912e8288164 noffle

[svn] * src/client.c: Only bail out of fetching multiple articles if the connection fails. If we do get a status from the upstream server note it and see what is reported for the next article. Otherwise failure to retrieve one article will cause all successive article fetches to fail even through they would succeed if tried. * src/lock.c: Fix assert in lazy locking. If another noffle signalled us to release the lock at the next close, and then repeats the signal so that it arrives during LOCK_closeDatabases, the signal handler was trying to close the databases again.
author bears
date Tue, 15 May 2001 13:07:53 +0100
parents 7ba337dafb2c
children fed1334d766b
comparison
equal deleted inserted replaced
182:a43a528cfbe7 183:c912e8288164
1 /* 1 /*
2 lock.c 2 lock.c
3 3
4 $Id: lock.c 260 2001-02-25 23:29:50Z bears $ 4 $Id: lock.c 292 2001-05-15 12:07:53Z bears $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
231 static void 231 static void
232 lockSignal( int sig ) 232 lockSignal( int sig )
233 { 233 {
234 UNUSED( sig ); 234 UNUSED( sig );
235 235
236 /*
237 * If we hold the lock right now, flag it to be released next close.
238 * Otherwise, if we are holding it lazily, release it.
239 */
236 if ( globalLock.lazyLockBusy ) 240 if ( globalLock.lazyLockBusy )
237 globalLock.lazyClose = FALSE; 241 globalLock.lazyClose = FALSE;
238 else 242 else if ( gotLock( &globalLock ) )
239 closeDatabases(); 243 closeDatabases();
240 return; 244 return;
241 } 245 }
242 246
243 /* Open all databases and set global lock. */ 247 /* Open all databases and set global lock. */
278 globalLock.lazyLockBusy = FALSE; 282 globalLock.lazyLockBusy = FALSE;
279 283
280 blockSignal( FALSE ); 284 blockSignal( FALSE );
281 } 285 }
282 286
283 /* Sync al databases to disc. Maintain global lock status. */ 287 /* Sync all databases to disc. Maintain global lock status. */
284 void 288 void
285 Lock_syncDatabases( void ) 289 Lock_syncDatabases( void )
286 { 290 {
287 Bool wasOpen; 291 Bool wasOpen;
288 292