pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:2147:    struct object *owner_obj;    struct key_storage *prev;    struct key_storage *next;    enum key_kind kind;   };      #define OB2KEY(X) ((struct key_storage *)((X)->storage))      /*! @class Mutex    *! -  *! @[Mutex] is a class that implements mutual exclusion locks. +  *! @[Mutex] is a class that implements mutual exclusion and shared locks. +  *!    *! Mutex locks are used to prevent multiple threads from simultaneously -  *! execute sections of code which access or change shared data. The basic +  *! executing sections of code which access or change shared data. The basic    *! operations for a mutex is locking and unlocking. If a thread attempts    *! to lock an already locked mutex the thread will sleep until the mutex    *! is unlocked.    *!    *! @note    *! This class is simulated when Pike is compiled without thread support,    *! so it's always available.    *! -  +  *! @note +  *! Support for shared locks was added in Pike 8.1.14. +  *!    *! 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, @    *! int(0..999999999) nanos)    *!