pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:433: Inside #if constant(__builtin.thread_id)
      //! @returns    //! Returns the result if available, a backtrace on failure,    //! and @expr{0@} (zero) otherwise.    mixed result()    {    return value;    }       //! Wait for completion. -  mixed `()() +  protected mixed `()()    {    object key = mutex->lock();    while(!ready) ft_cond->wait(key);    key = 0;    if( ready < 0 ) throw( value );    return value;    }       //! Register a callback to be called when    //! the result is available.
pike.git/lib/modules/Thread.pmod:963: Inside #if constant(__builtin.thread_id)
  //!   //! @seealso   //! @[ResourceCount], @[MutexKey]   //!   class ResourceCountKey {       private inherit __builtin.DestructImmediate;       /*semi*/private ResourceCount parent;    -  /*semi*/private void create(ResourceCount _parent) { +  protected void create(ResourceCount _parent) +  {    parent = _parent;    }    -  /*semi*/private void _destruct() { +  protected void _destruct() +  {    MutexKey key = parent->_mutex->lock();    --parent->_count;    parent->_cond->signal();    }   }      //! Implements an inverted-semaphore-like resource   //! counter. A thread can poll or perform a blocking wait for the   //! resource-count to drop below a certain @ref{level@}.   //!
pike.git/lib/modules/Thread.pmod:1013: Inside #if constant(__builtin.thread_id)
      //! Increments the resource-counter.    //! @returns    //! A @[ResourceCountKey] to decrement the resource-counter again.    /*semi*/final ResourceCountKey acquire() {    MutexKey key = _mutex->lock();    _count++;    return ResourceCountKey(this);    }    -  /*semi*/private string _sprintf(int type) { +  protected string _sprintf(int type) +  {    string res = UNDEFINED;    switch(type) {    case 'O':    res = sprintf("Count: %d", _count);    break;    case 'd':    res = sprintf("%d", _count);    break;    }    return res;