pike.git / lib / modules / Thread.pmod

version» Context lines:

pike.git/lib/modules/Thread.pmod:572:       MutexKey lock (int|void type)    {    switch (type) {    default:    error ("Unknown mutex locking style: %d\n", type);    case 0:    if (locks) error ("Recursive mutex locks.\n");    break;    case 1: -  break; -  case 2: +     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;    } -  +  }    locks++;    return MutexKey (dec_locks);    }       MutexKey trylock (int|void type)    {    switch (type) {    default:    error ("Unknown mutex locking style: %d\n", type);    case 0: