pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:113: Inside #if constant(thread_create)
   if(num-- == read_tres)    w_cond::broadcast();    }else{    num--;    w_cond::broadcast();    }    key = 0;    return tmp;    }    +  //! This function returns all values currently in the fifo. Values in +  //! the array will be in the order they were written. If there are no +  //! values present in the fifo the current thread will sleep until +  //! some other thread writes a value to the fifo. +  //! +  //! @seealso +  //! @[write()], @[read()] +  //!    array read_array()    {    array ret;    object key=lock::lock(2);    while(!num) r_cond::wait(key);    if(num==1)    {    ret=buffer[ptr..ptr];    buffer[ptr++] = 0; // Throw away any references.    ptr%=sizeof(buffer);