geom_event.c (e477abf734cc777a55286bfbd6b80a6760c96acf) geom_event.c (50199fa0d0739e52f6ae00c7917359b04b4de197)
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 259 unchanged lines hidden (view full) ---

268 g_free(ep);
269 }
270 return (1);
271}
272
273void
274g_run_events()
275{
1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

--- 259 unchanged lines hidden (view full) ---

268 g_free(ep);
269 }
270 return (1);
271}
272
273void
274g_run_events()
275{
276 int i;
277
278 for (;;) {
279 g_topology_lock();
280 while (one_event())
281 ;
282 mtx_assert(&g_eventlock, MA_OWNED);
276
277 for (;;) {
278 g_topology_lock();
279 while (one_event())
280 ;
281 mtx_assert(&g_eventlock, MA_OWNED);
283 i = g_wither_work;
284 if (i) {
282 if (g_wither_work) {
283 g_wither_work = 0;
285 mtx_unlock(&g_eventlock);
284 mtx_unlock(&g_eventlock);
286 while (i) {
287 i = g_wither_washer();
288 g_wither_work = i & 1;
289 i &= 2;
290 }
285 g_wither_washer();
291 g_topology_unlock();
292 } else {
293 g_topology_unlock();
294 msleep(&g_wait_event, &g_eventlock, PRIBIO | PDROP,
295 "-", TAILQ_EMPTY(&g_doorstep) ? 0 : hz / 10);
296 }
297 }
298 /* NOTREACHED */

--- 140 unchanged lines hidden ---
286 g_topology_unlock();
287 } else {
288 g_topology_unlock();
289 msleep(&g_wait_event, &g_eventlock, PRIBIO | PDROP,
290 "-", TAILQ_EMPTY(&g_doorstep) ? 0 : hz / 10);
291 }
292 }
293 /* NOTREACHED */

--- 140 unchanged lines hidden ---