Home | History | Annotate | Download | only in coregrind

Lines Matching refs:VG_

34 #include "pub_core_mallocfree.h"    // VG_(malloc)
45 ThreadId VG_(running_tid) = VG_INVALID_THREADID;
47 ThreadState *VG_(threads);
54 void VG_(init_Threads)(void)
59 addr = VG_(malloc)("init_Threads",
60 VG_N_THREADS * sizeof VG_(threads)[0] + LibVEX_GUEST_STATE_ALIGN - 1);
64 VG_(threads) = (ThreadState *)aligned_addr;
68 ANNOTATE_BENIGN_RACE_SIZED(&VG_(threads)[tid].status,
69 sizeof(VG_(threads)[tid].status), ""));
71 ANNOTATE_BENIGN_RACE_SIZED(&VG_(threads)[tid].os_state.exitcode,
72 sizeof(VG_(threads)[tid].os_state.exitcode),
77 const HChar* VG_(name_of_ThreadStatus) ( ThreadStatus status )
90 const HChar* VG_(name_of_VgSchedReturnCode) ( VgSchedReturnCode retcode )
101 ThreadState *VG_(get_ThreadState)(ThreadId tid)
104 vg_assert(VG_(threads)[tid].tid == tid);
105 return &VG_(threads)[tid];
108 Bool VG_(is_valid_tid) ( ThreadId tid )
113 if (VG_(threads)[tid].status == VgTs_Empty) return False;
118 ThreadId VG_(get_running_tid)(void)
120 return VG_(running_tid);
123 Bool VG_(is_running_thread)(ThreadId tid)
125 ThreadState *tst = VG_(get_ThreadState)(tid);
128 // tst->os_state.lwpid == VG_(gettid)() && // check we're this tid
129 VG_(running_tid) == tid && // and that we've got the lock
134 inline Bool VG_(is_exiting)(ThreadId tid)
136 vg_assert(VG_(is_valid_tid)(tid));
137 return VG_(threads)[tid].exitreason != VgSrc_None;
141 Int VG_(count_living_threads)(void)
147 if (VG_(threads)[tid].status != VgTs_Empty &&
148 VG_(threads)[tid].status != VgTs_Zombie)
155 Int VG_(count_runnable_threads)(void)
161 if (VG_(threads)[tid].status == VgTs_Runnable)
169 ThreadId VG_(lwpid_to_vgtid)(Int lwp)
174 if (VG_(threads)[tid].status != VgTs_Empty
175 && VG_(threads)[tid].os_state.lwpid == lwp)