pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c: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;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:1259:      void init_cond_obj(struct object *o) { co_init(THIS_COND); }   void exit_cond_obj(struct object *o) { co_destroy(THIS_COND); }      /*! @endclass    */      /*! @class Thread    */    - /* FIXME: -Hubbe */ +    /*! @decl array(mixed) backtrace()    *!    *! Returns the current call stack for the thread.    *!    *! @returns    *! The result has the same format as for @[predef::backtrace()].    *!    *! @seealso    *! @[predef::backtrace()]    */   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);    }   }      /*! @decl int status()    */   void f_thread_id_status(INT32 args)   {    pop_n_elems(args);