pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2981:    */   static void f_rwmutex_key_downgrade(INT32 args)   {    if (THIS_RWKEY->kind <= RWMUX_DOWNGRADED) {    /* Already a read lock or downgraded. */    return;    }    THIS_RWKEY->kind = RWMUX_DOWNGRADED;    THIS_RWKEY->rwmutex->readers = 1;    THIS_RWKEY->rwmutex->writers = -1; +  +  co_broadcast(&THIS_RWKEY->rwmutex->condition);   }      /*! @decl void upgrade()    *!    *! Upgrade this key back into a write-lock.    *!    *! This operation is only allowed on keys that have started    *! out as write-locks.    *!    *! This is a no-op on keys that already are write-locks.