pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:76: Inside #if constant(thread_create)
   int ptr, num;    int read_tres, write_tres;       //! This function returns the number of elements currently in the fifo.    //!    //! @seealso    //! @[read()], @[write()]    //!    int size() { return num; }    -  static nomask mixed read_unlocked() +  static final mixed read_unlocked()    {    mixed tmp=buffer[ptr];    buffer[ptr++] = 0; // Throw away any references.    ptr%=sizeof(buffer);    if(read_tres < sizeof(buffer))    {    if(num-- == read_tres)    w_cond::broadcast();    }else{    num--;
pike.git/lib/modules/Thread.pmod:127: Inside #if constant(thread_create)
   mixed try_read()    {    if (!num) return UNDEFINED;    object key=lock::lock();    if (!num) return UNDEFINED;    mixed res = read_unlocked();    key = 0;    return res;    }    -  static nomask array read_all_unlocked() +  static final array read_all_unlocked()    {    array ret;       switch (num) {    case 0:    ret = ({});    break;       case 1:    ret=buffer[ptr..ptr];
pike.git/lib/modules/Thread.pmod:192: Inside #if constant(thread_create)
   //!    array try_read_array()    {    if (!num) return ({});    object key=lock::lock();    array ret = read_all_unlocked();    key = 0;    return ret;    }    -  static nomask void write_unlocked (mixed value) +  static final void write_unlocked (mixed value)    {    buffer[(ptr + num) % sizeof(buffer)] = value;    if(write_tres)    {    if(num++ == write_tres)    r_cond::broadcast();    }else{    num++;    r_cond::broadcast();    }
pike.git/lib/modules/Thread.pmod:320: Inside #if constant(thread_create)
   {    if (w_ptr == r_ptr) return UNDEFINED;    object key=lock::lock();    if (w_ptr == r_ptr) return UNDEFINED;    mixed tmp=buffer[r_ptr];    buffer[r_ptr++] = 0; // Throw away any references.    key=0;    return tmp;    }    -  static nomask array read_all_unlocked() +  static final array read_all_unlocked()    {    array ret;       switch (w_ptr - r_ptr) {    case 0:    ret = ({});    break;       case 1:    ret=buffer[r_ptr..r_ptr];