--------------------- PatchSet 1384 Date: 2001/01/25 16:08:11 Author: darius Branch: sfs Tag: (none) Log: removing big race condition, replacing it with a much much smaller one - will need to involve some form of thread-signalling instead of this once other restructures are done. Members: src/fs/sfs/sfs_interface.c:1.1.2.5->1.1.2.6 Index: squid/src/fs/sfs/sfs_interface.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/sfs/Attic/sfs_interface.c,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/src/fs/sfs/sfs_interface.c 25 Jan 2001 15:15:20 -0000 1.1.2.5 +++ squid/src/fs/sfs/sfs_interface.c 25 Jan 2001 16:08:11 -0000 1.1.2.6 @@ -321,10 +321,10 @@ pthread_mutex_init(&(_sfs_mounted[i].req_signal_lock), NULL); pthread_cond_init(&(_sfs_mounted[i].req_signal), NULL); pthread_mutex_init(&(_sfs_mounted[i].openfiles_lock), NULL); - _sfs_mounted[i].accepting_requests = 1; pthread_create(&(_sfs_mounted[i].thread_id), NULL, (void *)&sfs_thread_loop, &(_sfs_mounted[i])); - sched_yield(); /* Allow the sfs_thread_loop to be created .. */ -/* Return the sfsid */ + while (!(_sfs_mounted[i].accepting_requests)) + sleep(1); + /* Return the sfsid */ return i; }