pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2338:    add_ref (OB2KEY(o)->mutex_obj = Pike_fp->current_object);    m->key=o;    i=1;    }       pop_n_elems(args);    if(i)    {    push_object(o);    } else { +  /* NB: We know that mutex_key doesn't have an lfun:_destruct() +  * that inhibits our destruct(). +  */    destruct(o);    free_object(o);    push_int(0);    }   }      /*! @decl Thread.Thread current_locking_thread()    *!    *! This mutex method returns the object that identifies the thread that    *! has locked the mutex. 0 is returned if the mutex isn't locked.
pike.git/src/threads.c:2462: Inside #if undefined(PICKY_MUTEX) and #if defined(PIKE_DEBUG)
   else {   #ifdef PIKE_DEBUG    if (m->num_waiting)    Pike_error ("key/num_waiting confusion.\n");   #endif    co_destroy(& m->condition);    }   #else    if(key) {    m->key=0; +  /* NB: We know that mutex_key doesn't have an lfun:_destruct() +  * that inhibits our destruct(). +  */    destruct(key); /* Will destroy m->condition if m->num_waiting is zero. */    if(m->num_waiting)    {    THREADS_FPRINTF(1, "Destructed mutex is being waited on.\n");    THREADS_ALLOW();    /* exit_mutex_key_obj has already signalled, but since the    * waiting threads will throw an error instead of making a new    * lock we need to double it to a broadcast. The last thread    * that stops waiting will destroy m->condition. */    co_broadcast (&m->condition);
pike.git/src/threads.c:4266:    if (Pike_interpreter.thread_state) {    thread_table_delete(Pike_interpreter.thread_state);    Pike_interpreter.thread_state = NULL;    }       if(backend_thread_obj)    {    /* Switch back to the original interpreter struct. */    *original_interpreter = Pike_interpreter;    +  /* NB: We know that mutex_key doesn't have an lfun:_destruct() +  * that inhibits our destruct(). +  */    destruct(backend_thread_obj);    free_object(backend_thread_obj);    backend_thread_obj = NULL;       Pike_interpreter_pointer = original_interpreter;       destruct_objects_to_destruct_cb();    }       if(condition_program)