pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:147: Inside #if constant(thread_create)
   //! The default @[size] is 128.    //!    static void create(int|void size)    {    write_tres=0;    buffer=allocate(read_tres=size || 128);    }       static string _sprintf( int f )    { -  switch( f ) -  { -  case 't': -  return "Thread.Fifo"; -  case 'O': -  return sprintf( "%t(%d / %d)", this_object(), size(), read_tres ); +  return f=='O' && sprintf( "%O(%d / %d)", this_program, +  size(), read_tres );    }   } - }; +       //! @[Queue] implements a queue, or a pipeline. The main difference   //! between @[Queue] and @[Fifo] is that @[Queue]   //! will never block in write(), only allocate more memory.   //!   //! @note   //! Queues are only available on systems with POSIX or UNIX or WIN32   //! thread support.   //!   //! @seealso
pike.git/lib/modules/Thread.pmod:226: Inside #if constant(thread_create)
   r_ptr=0;    }    buffer[w_ptr] = value;    w_ptr++;    key=0; // Must free this one _before_ the signal...    r_cond::signal();    }       static string _sprintf( int f )    { -  switch( f ) -  { -  case 't': -  return "Thread.Queue"; -  case 'O': -  return sprintf( "%t(%d)", this_object(), size() ); +  return f=='O' && sprintf( "%O(%d)", this_program, size() );    }   } - } +             optional class Farm   {    static Mutex mutex = Mutex();    static Condition ft_cond = Condition();    static Queue job_queue = Queue();       class Result
pike.git/lib/modules/Thread.pmod:393: Inside #if constant(thread_create)
   }          static string _sprintf( int f )    {    switch( f )    {    case 't':    return "Thread.Farm().Handler";    case 'O': -  return sprintf( "%t(%f / %d, %d)", total_time, max_time,handled ); +  return sprintf( "%t(%f / %d, %d)", this_object(), +  total_time, max_time, handled );    }    }    }       static array(Handler) threads = ({});    static array(Handler) free_threads = ({});    static int max_num_threads = 20;       static Handler aquire_thread()    {
pike.git/lib/modules/Thread.pmod:510: Inside #if constant(thread_create)
   " Jobs in queue = %d\n\n",    max_num_threads, sizeof(threads),    (sizeof(threads)-sizeof(free_threads)),    job_queue->size() );       foreach( threads, Handler t )    res += t->debug_status();    return res;    }    -  +     static string _sprintf( int f )    { -  switch( f ) -  { -  case 't': -  return "Thread.Farm"; -  case 'O': -  return sprintf( "%t(/* %s */)", this_object, debug_status() ); +  return f=='O' && sprintf( "%O(/* %s */)", this_program, debug_status() );    } -  } +     -  -  +     static void create()    {    thread_create( dispatcher );    }   }      #else /* !constant(thread_create) */      // Simulations of some of the classes for nonthreaded use.