pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2167:    *! This class is simulated when Pike is compiled without thread support,    *! so it's always available.    *!    *! In POSIX threads, mutex locks can only be unlocked by the same thread    *! that locked them. In Pike any thread can unlock a locked mutex.    */      /*! @decl MutexKey lock()    *! @decl MutexKey lock(int type)    *! @decl MutexKey lock(int type, int(0..)|float seconds) -  *! @decl MutexKey lock(int type, int(0..) seconds @ +  *! @decl MutexKey lock(int type, int(0..) seconds, @    *! int(0..999999999) nanos)    *!    *! This function attempts to lock the mutex. If the mutex is already    *! locked by a different thread the current thread will sleep until the    *! mutex is unlocked. The value returned is the 'key' to the lock. When    *! the key is destructed or has no more references the mutex will    *! automatically be unlocked.    *!    *! The @[type] argument specifies what @[lock()] should do if the    *! mutex is already locked by this thread:
pike.git/src/threads.c:2390:    THREADS_FPRINTF(1, "LOCK k:%p, m:%p(%p), t:%p\n",    key, m, key->mut,    Pike_interpreter.thread_state);    pop_n_elems(args);    push_object(o);   }      /*! @decl MutexKey shared_lock()    *! @decl MutexKey shared_lock(int type)    *! @decl MutexKey shared_lock(int type, int(0..)|float seconds) -  *! @decl MutexKey shared_lock(int type, int(0..) seconds @ +  *! @decl MutexKey shared_lock(int type, int(0..) seconds, @    *! int(0..999999999) nanos)    *!    *! This function attempts to lock the mutex. If the mutex is already    *! locked by a different thread the current thread will sleep until the    *! mutex is unlocked. The value returned is the 'key' to the lock. When    *! the key is destructed or has no more references the mutex will    *! automatically be unlocked.    *!    *! The @[type] argument specifies what @[lock()] should do if the    *! mutex is already locked exclusively by this thread: