--------------------- PatchSet 1385 Date: 2001/01/25 16:08:54 Author: darius Branch: sfs Tag: (none) Log: signalling that mount is ready to use from here - tiny race (see sfs_interface.c for call). Members: src/fs/sfs/sfs_llo.c:1.1.2.3->1.1.2.4 Index: squid/src/fs/sfs/sfs_llo.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/sfs_llo.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/src/fs/sfs/sfs_llo.c 25 Jan 2001 15:15:20 -0000 1.1.2.3 +++ squid/src/fs/sfs/sfs_llo.c 25 Jan 2001 16:08:54 -0000 1.1.2.4 @@ -70,14 +70,17 @@ sigaddset(&new, SIGALRM); pthread_sigmask(SIG_BLOCK, &new, NULL); -/* Set a conditional, when it's realised scan through the service list. */ + /* tiny race condition here - this should be done with pthread_locks of + * some sort */ + mount_point->accepting_requests = 1; + /* Set a conditional, when it's realised scan through the service list. */ pthread_cond_init(&(mount_point->req_signal), NULL); pthread_mutex_lock(&(mount_point->req_signal_lock)); i = 0; while (1) { - printf("DEBUG: Going into wait...\n"); + printf("DEBUG: Going into wait... (%d pending)\n",mount_point->pending_requests); pthread_cond_wait(&(mount_point->req_signal), &(mount_point->req_signal_lock)); - printf("DEBUG: Coming out of wait...\n"); + printf("DEBUG: Coming out of wait... (%d pending)\n",mount_point->pending_requests); tnode = mount_point->request_queue.head; /* Should I lock the request queue while I cycle through these? Probably @@ -121,8 +124,7 @@ } } } - if (tnode->next) - tnode = tnode->next; + tnode = tnode->next; } i = (i + 1) % 10; if (i == 0) { @@ -319,7 +321,8 @@ lnode = lnode->next; } i = 0; - /* Waiting for the request queue to be empty of all bar the umount request */ + /* Waiting for the request queue to be empty of all bar the umount + * request */ while ((mnt->request_queue.head->next) && (i < 5)) { i++; sleep(1);