pike.git/
src/
error.c
Branch:
Tag:
Non-build tags
All tags
No tags
2009-03-13
2009-03-13 00:29:19 by Martin Stjernholm <mast@lysator.liu.se>
7279d9814f98320c3be5f56136bf27510961eb2e (
13
lines) (+
8
/-
5
)
[
Show
|
Annotate
]
Branch:
7.9
Don't risk hanging on mutexes when threads are disabled in Pike_fatal.
Rev: src/error.c:1.167
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: error.c,v 1.
166
2008
/
10
/
04
17
:
19
:
05
mast Exp $
+
|| $Id: error.c,v 1.
167
2009
/
03
/
13
00
:
29:
19 mast Exp $
*/ #define NO_PIKE_SHORTHAND
619:
{ JMP_BUF jmp; struct callback_list saved_eval_cbs = evaluator_callbacks;
-
/*
Don't
want
thread switches or any other
evaluator
stuff
while
-
*
we let the master describe the backtrace below.
*/
-
low_
init_threads_disable
()
;
+
/*
Simulate
threads_disabled
to avoid
thread switches or any other
+
*
evaluator
stuff
while
we let the master describe the backtrace
+
*
below.
Doing it the naughty way without going through
+
*
init_threads_disable
etc to avoid hanging on runaway locks. */
+
threads_disabled++
;
MEMSET (&evaluator_callbacks, 0, sizeof (evaluator_callbacks)); if (SETJMP (jmp)) fprintf(stderr,"Got exception when trying to describe backtrace.\n");
633:
write_to_stderr(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); } UNSETJMP (jmp);
-
exit_
threads_
disable (NULL)
;
+
threads_
disabled--
;
evaluator_callbacks = saved_eval_cbs; }else{ fprintf(stderr,"No stack - no backtrace.\n");