pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2208:    *! explicitly destruct mutexes to unlock them.    *!    *! @seealso    *! @[trylock()]    */   void f_mutex_lock(INT32 args)   {    struct mutex_storage *m;    struct key_storage *key;    struct object *o; -  INT_TYPE type; +  INT_TYPE type = 0;       DEBUG_CHECK_THREAD();       m=THIS_MUTEX; -  if(!args) -  type=0; -  else -  get_all_args(NULL, args, "%i", &type); +  get_all_args(NULL, args, ".%i", &type);       switch(type)    {    default:    bad_arg_error("lock", args, 2, "int(0..2)", Pike_sp+1-args,    "Unknown mutex locking style: %"PRINTPIKEINT"d\n",type);          case 0:    case 2:
pike.git/src/threads.c:2500:    *! unlocked.    *!    *! @seealso    *! @[lock()]    */   void f_mutex_trylock(INT32 args)   {    struct mutex_storage *m;    struct key_storage *key;    struct object *o; -  INT_TYPE type; +  INT_TYPE type = 0;    int i=0;       /* No reason to release the interpreter lock here    * since we aren't calling any functions that take time.    */       m=THIS_MUTEX;    -  if(!args) -  type=0; -  else -  get_all_args(NULL, args, "%i", &type); +  get_all_args(NULL, args, ".%i", &type);       switch(type)    {    default:    bad_arg_error("trylock", args, 2, "int(0..2)", Pike_sp+1-args,    "Unknown mutex locking style: %"PRINTPIKEINT"d\n",type);       case 0:    for (key = m->key; key; key = key->next) {    if(key->owner == Pike_interpreter.thread_state)