Lines Matching defs:threads
36 #include "threads.h"
40 * allows me to wait for multiple threads to exit. We use a
41 * condition variable to signal a thread's death. All threads
43 * don't need to add any code in the threads themselves.
51 struct threads *threads;
56 /* A set of threads. */
57 struct threads {
64 static void *thread_start(void *); /* Common entry point for threads. */
66 static void threads_lock(struct threads *);
67 static void threads_unlock(struct threads *);
70 threads_lock(struct threads *tds)
79 threads_unlock(struct threads *tds)
87 /* Create a new set of threads. */
88 struct threads *
91 struct threads *tds;
93 tds = xmalloc(sizeof(struct threads));
103 threads_create(struct threads *tds, void *(*start)(void *), void *data)
110 td->threads = tds;
113 /* We don't use pthread_join() to wait for the threads to finish. */
126 threads_wait(struct threads *tds)
144 /* Free a threads set. */
146 threads_free(struct threads *tds)
157 * Common entry point for threads. This just calls the real start
164 struct threads *tds;
168 tds = td->threads;