Lines Matching +full:sync +full:- +full:write
31 # or O_EXLOCK can increase the write count while it waits. If the process
36 # The second change closes a race where a read-only open() with O_SHLOCK or
37 # O_EXLOCK may return successfully while the write count is non-zero due to
41 # ETXTBUSY even though the other process that held a write lock has closed
51 [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
57 mycc -o advlock -Wall -Wextra -O0 -g advlock.c || exit 1
58 rm -f advlock.c
60 mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint
61 mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart
62 mdconfig -a -t swap -s 512m -u $mdstart || exit 1
72 while mount | grep "on $mntpoint " | grep -q /dev/md; do
75 mdconfig -d -u $mdstart
76 rm -f /tmp/advlock
100 #define SYNC 0
118 atomic_add_int(&share[SYNC], 1);
119 while (share[SYNC] != PARALLEL)
124 if ((fd = open(cmdline[0], O_RDONLY | O_SHLOCK)) == -1)
138 atomic_add_int(&share[SYNC], 1);
139 while (share[SYNC] != PARALLEL)
144 if ((fd = open(cmdline[0], O_WRONLY | O_EXLOCK)) == -1) {
161 atomic_add_int(&share[SYNC], 1);
162 while (share[SYNC] != PARALLEL)
167 if ((fd = open(cmdline[0], O_RDONLY | O_SHLOCK)) == -1)
170 if (execve(cmdline[0], cmdline, NULL) == -1)
182 atomic_add_int(&share[SYNC], 1);
183 while (share[SYNC] != PARALLEL)
188 if ((fd = open(cmdline[0], O_RDONLY | O_EXLOCK)) == -1)
191 if (execve(cmdline[0], cmdline, NULL) == -1)
206 -1, 0)) == MAP_FAILED)
212 while ((time(NULL) - start) < RUNTIME) {
214 share[SYNC] = 0;
227 share[SYNC] = 0;