pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:652:    case 0:    if (locks) error ("Recursive mutex locks.\n");    break;    case 1:    if (locks)    // To be really accurate we should hang now, but somehow    // that doesn't seem too useful.    error ("Deadlock detected.\n");    break;    case 2: -  if (locks) { -  locks++; -  return 0; +  if (locks) return 0;    } -  } +     locks++;    return MutexKey (dec_locks);    }       //! @decl MutexKey trylock()    //! @decl MutexKey trylock(int type)    //!    //! This function performs the same operation as @[lock()], but if the mutex    //! is already locked, it will return zero instead of sleeping until it's    //! unlocked.