Lines Matching +full:x +full:- +full:rc

37 mycc -o pthread6 -Wall -Wextra -O2 -g -gdwarf-2 pthread6.c -lpthread || exit 1
38 rm -f pthread6.c /tmp/pthread6.core
40 daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)"
41 sleep `jot -r 1 1 9`
46 while pgrep -q swap; do
51 rm -f /tmp/pthread6 /tmp/pthread6.core
55 * Threaded producer-consumer test.
81 #define LOCK(x) plock(&x.mtx)
82 #define UNLOCK(x) punlock(&x.mtx)
83 #define SIGNAL(x) psig(&x.wait)
84 #define WAIT(x) pwait(&x.wait, &x.mtx)
120 int rc;
122 if ((rc = pthread_mutex_lock(l)) != 0)
123 errc(1, rc, "pthread_mutex_lock");
129 int rc;
131 if ((rc = pthread_mutex_unlock(l)) != 0)
132 errc(1, rc, "pthread_mutex_unlock");
138 int rc;
140 if ((rc = pthread_cond_signal(c)) != 0)
141 errc(1, rc, "pthread_cond_signal");
147 int rc;
149 if ((rc = pthread_cond_wait(c, l)) != 0)
150 errc(1, rc, "pthread_cond_wait");
165 asprintf(&file->name, "%s/filename_too-long:%d", dirname1, i);
196 filename = strrchr(file->name, '/');
199 free(file->name);
200 file->name = newname;
227 free(file->name);
237 int rc;
253 if ((rc = pthread_mutex_init(&newfiles.mtx, pattr)) != 0)
254 errc(1, rc, "pthread_mutex_init()");
255 if ((rc = pthread_cond_init(&newfiles.wait, NULL)) != 0)
256 errc(1, rc, "pthread_cond_init()");
257 if ((rc = pthread_mutex_init(&renamedfiles.mtx, NULL)) != 0)
258 errc(1, rc, "pthread_mutex_init()");
259 if ((rc = pthread_cond_init(&renamedfiles.wait, NULL)) != 0)
260 errc(1, rc, "pthread_cond_init()");
264 if ((rc = pthread_create(&tid[0], NULL, loop_create, NULL)) != 0)
265 errc(1, rc, "pthread_create()");
266 if ((rc = pthread_create(&tid[1], NULL, loop_rename, NULL)) != 0)
267 errc(1, rc, "pthread_create()");
268 if ((rc = pthread_create(&tid[2], NULL, loop_unlink, NULL)) != 0)
269 errc(1, rc, "pthread_create()");
274 if ((rc = pthread_join(tid[i], NULL)) != 0)
275 errc(1, rc, "pthread_join(%d)", i);
278 if ((rc = pthread_mutex_destroy(&newfiles.mtx)) != 0)
279 errc(1, rc, "pthread_mutex_destroy(newfiles)");
280 if ((rc = pthread_cond_destroy(&newfiles.wait)) != 0)
281 errc(1, rc, "pthread_cond_destroy(newfiles)");
282 if ((rc = pthread_mutex_destroy(&renamedfiles.mtx)) != 0)
283 errc(1, rc, "pthread_mutex_destroy(renamedfiles)");
284 if ((rc = pthread_cond_destroy(&renamedfiles.wait)) != 0)
285 errc(1, rc, "pthread_cond_destroy(renamedfiles)");