Lines Matching +full:sync +full:- +full:2
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
12 * 2. Redistributions in binary form must reproduce the above copyright
33 * cc mevent_test.c mevent.c -lpthread
80 diff = (tevbuf[j] - tevbuf[j-1]) * 1000000 / tsc_freq; in timer_print()
89 sum/(TEVSZ - 1)); in timer_print()
118 struct esync *sync = param; in echoer_callback() local
120 pthread_mutex_lock(&sync->e_mt); in echoer_callback()
121 pthread_cond_signal(&sync->e_cond); in echoer_callback()
122 pthread_mutex_unlock(&sync->e_mt); in echoer_callback()
128 struct esync sync; in echoer() local
134 pthread_mutex_init(&sync.e_mt, NULL); in echoer()
135 pthread_cond_init(&sync.e_cond, NULL); in echoer()
137 pthread_mutex_lock(&sync.e_mt); in echoer()
139 mev = mevent_add(fd, EVF_READ, echoer_callback, &sync); in echoer()
145 while (!pthread_cond_wait(&sync.e_cond, &sync.e_mt)) { in echoer()
157 pthread_mutex_unlock(&sync.e_mt); in echoer()
158 pthread_mutex_destroy(&sync.e_mt); in echoer()
159 pthread_cond_destroy(&sync.e_cond); in echoer()