summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/threads/assfail.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2015-06-02 17:12:04 +0000
committerRobert Mustacchi <rm@joyent.com>2015-09-14 13:47:46 -0700
commit0d045c0d0cb001d79480ee33be28514e847f8612 (patch)
tree3454a95214e5f8ac18f52c0db7886d5027091b9a /usr/src/lib/libc/port/threads/assfail.c
parent7bbfa3ee1f517d6d5762f10047886094cea843a1 (diff)
downloadillumos-joyent-0d045c0d0cb001d79480ee33be28514e847f8612.tar.gz
6209 libc mutexes break kernel writers hearts
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/lib/libc/port/threads/assfail.c')
-rw-r--r--usr/src/lib/libc/port/threads/assfail.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/lib/libc/port/threads/assfail.c b/usr/src/lib/libc/port/threads/assfail.c
index 8aebefbe4a..b40e6dc029 100644
--- a/usr/src/lib/libc/port/threads/assfail.c
+++ b/usr/src/lib/libc/port/threads/assfail.c
@@ -25,6 +25,7 @@
*/
/*
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright 2015 Joyent, Inc.
*/
#include "lint.h"
@@ -36,6 +37,8 @@ ulwp_t *panic_thread;
static mutex_t assert_lock = DEFAULTMUTEX;
static ulwp_t *assert_thread = NULL;
+mutex_t *panic_mutex = NULL;
+
/*
* Called from __assert() to set panicstr and panic_thread.
*/
@@ -129,6 +132,13 @@ aio_panic(const char *why)
common_panic("*** libc aio system failure: ", why);
}
+void
+mutex_panic(mutex_t *mp, const char *why)
+{
+ panic_mutex = mp;
+ common_panic("*** libc mutex system failure: ", why);
+}
+
/*
* Utility function for converting a long integer to a string, avoiding stdio.
* 'base' must be one of 10 or 16