Branch: Tag:

2001-09-05

2001-09-05 23:44:32 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

fix for [bug 2167 (#2167)] (can only happen when using Java callbacks I think)

Rev: src/builtin.cmod:1.64
Rev: src/threads.c:1.162

1:   #include "global.h" - RCSID("$Id: threads.c,v 1.161 2001/08/23 18:10:57 per Exp $"); + RCSID("$Id: threads.c,v 1.162 2001/09/05 23:44:32 hubbe Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;
1266:   /*! @class Thread    */    - /* FIXME: -Hubbe */ +    /*! @decl array(mixed) backtrace()    *!    *! Returns the current call stack for the thread.
1279:    */   void f_thread_backtrace(INT32 args)   { +  void low_backtrace(struct Pike_interpreter *);    struct thread_state *foo = THIS_THREAD; -  struct thread_state *bar = OBJ2THREAD( Pike_interpreter.thread_id ); -  struct svalue *osp = Pike_sp; +     pop_n_elems(args); -  +     if(foo->state.stack_pointer)    { -  SWAP_OUT_THREAD(bar); -  SWAP_IN_THREAD(foo); -  Pike_sp=osp; -  f_backtrace(0); -  osp=Pike_sp; -  Pike_sp=foo->state.stack_pointer; -  SWAP_OUT_THREAD(foo); -  SWAP_IN_THREAD(bar); -  Pike_sp=osp; -  } else { +  low_backtrace(& foo->state); +  }else{    push_int(0);    f_allocate(1);    }