Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/dtrace DTrace: okay *rea...
details: https://anonhg.NetBSD.org/src/rev/c21a3426aeac
branches: trunk
changeset: 752417:c21a3426aeac
user: darran <darran%NetBSD.org@localhost>
date: Thu Feb 25 16:49:19 2010 +0000
description:
DTrace: okay *really* fix the deadman exit handling. No need for that
over-complicated handshake. Fixes a lockdebug mutex held issue.
diffstat:
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diffs (62 lines):
diff -r 2ebb35bd22ba -r c21a3426aeac external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
--- a/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Thu Feb 25 16:15:57 2010 +0000
+++ b/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Thu Feb 25 16:49:19 2010 +0000
@@ -246,9 +246,7 @@
uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */
#endif
-kmutex_t dtrace_deadman_mutex;
void *dtrace_deadman_wchan;
-void *dtrace_cleanup_wchan;
int dtrace_deadman_alive; /* deadman thread keep alive */
lwp_t *dtrace_deadman_proc;
#endif
@@ -12837,6 +12835,9 @@
dtrace_state_t *state = arg;
hrtime_t now;
int res;
+ kmutex_t dtrace_deadman_mutex;
+
+ mutex_init(&dtrace_deadman_mutex, NULL, MUTEX_DEFAULT, NULL);
while (dtrace_deadman_alive) {
mutex_enter(&dtrace_deadman_mutex);
@@ -12873,8 +12874,7 @@
state->dts_alive = now;
}
- /* let the cleanup code know we're done */
- dtrace_deadman_alive = -1;
+ mutex_destroy(&dtrace_deadman_mutex);
kthread_exit(0);
}
@@ -13446,7 +13446,6 @@
((dtrace_optval_t)hz * opt[DTRACEOPT_CLEANRATE]) / NANOSEC,
dtrace_state_clean, state);
- mutex_init(&dtrace_deadman_mutex, NULL, MUTEX_DEFAULT, NULL);
dtrace_deadman_wchan = &dtrace_deadman_wchan;
dtrace_deadman_alive = 1;
@@ -13731,20 +13730,10 @@
#else
callout_stop(&state->dts_cleaner);
- /* Kill off the deadman thread */
if (dtrace_deadman_alive) {
/* tell the deadman thread to exit */
dtrace_deadman_alive = 0;
- dtrace_cleanup_wchan = &dtrace_cleanup_wchan;
wakeup(dtrace_deadman_wchan);
- /* Wait for thread to exit */
- mutex_enter(&dtrace_deadman_mutex);
- do {
- mtsleep(&dtrace_cleanup_wchan, PRI_BIO,
- "deadman_exit", 10, &dtrace_deadman_mutex);
- } while (!dtrace_deadman_alive);
- mutex_exit(&dtrace_deadman_mutex);
- mutex_destroy(&dtrace_deadman_mutex);
}
#endif
Home |
Main Index |
Thread Index |
Old Index