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

37 mycc -o pthread4 -Wall -Wextra -O2 -g -gdwarf-2 pthread4.c -lpthread || exit 1
38 rm -f pthread4.c /tmp/pthread4.core
40 log=/tmp/pthread4.`date '+%Y%m%d-%H%M'`
42 [ $i -eq 1 ] && echo "# `uname -v`"
43 time sh -c '
50 rm -f /tmp/pthread4
52 if [ -n "$bench" ]; then
53 pair=`ls /tmp/pthread4* | egrep "pthread4\.[0-9]{8}-" | sort |
54 tail -2 | tr '\n' ' '`
55 ministat -w 72 $pair
57 rm -f $log
63 * Threaded producer-consumer test.
88 #define LOCK(x) plock(&x.mtx)
89 #define UNLOCK(x) punlock(&x.mtx)
90 #define SIGNAL(x) psig(&x.wait)
91 #define WAIT(x) pwait(&x.wait, &x.mtx)
128 int rc;
130 if ((rc = pthread_mutex_lock(l)) != 0)
131 errc(1, rc, "pthread_mutex_lock");
137 int rc;
139 if ((rc = pthread_mutex_unlock(l)) != 0)
140 errc(1, rc, "pthread_mutex_unlock");
146 int rc;
148 if ((rc = pthread_cond_signal(c)) != 0)
149 errc(1, rc, "pthread_cond_signal");
155 int rc;
157 if ((rc = pthread_cond_wait(c, l)) != 0)
158 errc(1, rc, "pthread_cond_wait");
173 asprintf(&file->name, "%s/filename_too-long:%d", dirname1, i);
204 filename = strrchr(file->name, '/');
207 free(file->name);
208 file->name = newname;
235 free(file->name);
245 int rc;
260 if ((rc = pthread_mutex_init(&newfiles.mtx, pattr)) != 0)
261 errc(1, rc, "pthread_mutex_init()");
262 if ((rc = pthread_cond_init(&newfiles.wait, NULL)) != 0)
263 errc(1, rc, "pthread_cond_init()");
264 if ((rc = pthread_mutex_init(&renamedfiles.mtx, NULL)) != 0)
265 errc(1, rc, "pthread_mutex_init()");
266 if ((rc = pthread_cond_init(&renamedfiles.wait, NULL)) != 0)
267 errc(1, rc, "pthread_cond_init()");
272 if ((rc = pthread_create(&tid[0], NULL, loop_create, NULL)) != 0)
273 errc(1, rc, "pthread_create()");
274 if ((rc = pthread_create(&tid[1], NULL, loop_rename, NULL)) != 0)
275 errc(1, rc, "pthread_create()");
276 if ((rc = pthread_create(&tid[2], NULL, loop_unlink, NULL)) != 0)
277 errc(1, rc, "pthread_create()");
280 if ((rc = pthread_join(tid[i], NULL)) != 0)
281 errc(1, rc, "pthread_join(%d)", i);
284 if ((rc = pthread_mutex_destroy(&newfiles.mtx)) != 0)
285 errc(1, rc, "pthread_mutex_destroy(newfiles)");
286 if ((rc = pthread_cond_destroy(&newfiles.wait)) != 0)
287 errc(1, rc, "pthread_cond_destroy(newfiles)");
288 if ((rc = pthread_mutex_destroy(&renamedfiles.mtx)) != 0)
289 errc(1, rc, "pthread_mutex_destroy(renamedfiles)");
290 if ((rc = pthread_cond_destroy(&renamedfiles.wait)) != 0)
291 errc(1, rc, "pthread_cond_destroy(renamedfiles)");