Lines Matching defs:mutex
212 int kw_flags; /* mutex, cvar options/flags */
218 int kw_type; /* queue type like mutex, cvar, etc */
230 /* for mutex and cvar we need to track I bit values */
235 uint32_t kw_initcountseq; /* highest seq with Ibit on for mutex and cvar*/
246 lck_mtx_t kw_lock; /* mutex lock protecting this structure */
263 #define PTH_RWL_RETRYBIT 0x08 /* mutex retry wait */
265 #define PTH_RWL_MTXNONE 0x10 /* indicates the cvwait does not have mutex held */
267 #define PTH_RWL_MTX_WAIT 0x20 /* in cvar in mutex wait */
270 #define PTH_RWL_TRYLKBIT 0x40 /* trylock attempt (mutex only) */
274 /* UBIT values for mutex, cvar */
389 #define _PTHREAD_MTX_OPT_MUTEX 0x2000 /* this is a mutex type */
476 ksyn_wait_queue_t ksyn_wq_hash_lookup(user_addr_t mutex, proc_t p, int flags, uint64_t object, uint64_t offset);
477 int ksyn_wqfind(user_addr_t mutex, uint32_t mgen, uint32_t ugen, uint32_t rw_wc, uint64_t tid, int flags, int wqtype , ksyn_wait_queue_t * wq);
479 extern int ksyn_findobj(uint64_t mutex, uint64_t * object, uint64_t * offset);
584 /* routine to drop the mutex unlocks , used both for mutexunlock system call and drop during cond wait */
620 panic("psynch_mutexdrop_internal: panic unable to wakeup firstfit mutex thread\n");
633 /* since the grant could be cv, make sure mutex wait is set incase the thread interrupted out */
644 panic("psynch_mutexdrop_internal: panic unable to wakeup fairshare mutex thread\n");
671 //__FAILEDUSERTEST__("psynch_mutexdrop_internal: FS mutex unlock sequence higher than the lowest one is queue\n");
676 /* since the grant could be cv, make sure mutex wait is set incase the thread interrupted out */
685 panic("psynch_mutexdrop_internal: panic unable to wakeup fairshare mutex thread\n");
757 user_addr_t mutex = uap->mutex;
772 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_START, (uint32_t)mutex, mgen, ugen, flags, 0);
773 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_NONE, (uint32_t)mutex, mgen, ugen, (uint32_t)tid, 0);
792 error = ksyn_wqfind(mutex, mgen, ugen, 0, tid, flags, (KSYN_WQTYPE_INWAIT|KSYN_WQTYPE_MTX), &kwq);
795 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_END, (uint32_t)mutex, 1, 0xdeadbeef, error, 0);
819 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_NONE, (uint32_t)mutex, 0xfafafaf1, kwe->kwe_psynchretval, kwq->kw_pre_intrcount, 0);
865 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_END, (uint32_t)mutex, 2, 0xdeadbeef, error, 0);
880 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_MLWAIT | DBG_FUNC_END, (uint32_t)mutex, 0xeeeeeeed, updatebits, error, 0);
940 user_addr_t mutex = uap->mutex;
949 error = ksyn_wqfind(mutex, mgen, ugen, 0, tid, flags, (KSYN_WQTYPE_INDROP | KSYN_WQTYPE_MTX), &kwq);
1236 user_addr_t mutex = uap->mutex;
1260 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_CVWAIT | DBG_FUNC_NONE, (uint32_t)mutex, mgen, ugen, flags, 0);
1284 if (mutex != (user_addr_t)0) {
1285 error = ksyn_wqfind(mutex, mgen, ugen, 0, 0, flags, (KSYN_WQTYPE_INDROP | KSYN_WQTYPE_MTX), &kwq);
1289 __PTHREAD_TRACE_DEBUG(_PSYNCH_TRACE_CVWAIT | DBG_FUNC_END, (uint32_t)mutex, 2, 0xdeadbeef, error, 0);
1545 /* mutex type */
2637 ksyn_wq_hash_lookup(user_addr_t mutex, proc_t p, int flags, uint64_t object, uint64_t objoffset)
2655 kwq = (&hashptr[mutex & pthhash])->lh_first;
2658 if (kwq->kw_addr == mutex) {
2730 ksyn_wqfind(user_addr_t mutex, uint32_t mgen, uint32_t ugen, uint32_t rw_wc, uint64_t tid, int flags, int wqtype, ksyn_wait_queue_t * kwqp)
2744 (void)ksyn_findobj(mutex, &object, &offset);
2760 kwq = ksyn_wq_hash_lookup(mutex, p, flags, object, offset);
2772 kwq->kw_addr = mutex;
2815 nkwq->kw_addr = mutex;
2846 kwq = ksyn_wq_hash_lookup(mutex, p, flags, object, offset);
2858 kwq->kw_addr = mutex;
2915 LIST_INSERT_HEAD(&hashptr[mutex & pthhash], kwq, kw_hash);
3150 ksyn_findobj(uint64_t mutex, uint64_t * objectp, uint64_t * offsetp)
3156 kret = vm_map_page_info(current_map(), mutex, VM_PAGE_INFO_BASIC,
3871 /* TBD: if retry bit is set for mutex, add it to the head */