* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <debug/Thread.hh>
#include <sim/futex_map.hh>
FutexKey::FutexKey(uint64_t addr_in, uint64_t tgid_in)
WaiterState::WaiterState(ThreadContext* _tc, int _bitmask)
: tc(_tc), bitmask(_bitmask) { }
-WaiterState::WaiterState(ThreadContext* _tc)
- : tc(_tc), bitmask(0xffffffff) { }
-
bool
WaiterState::checkMask(int wakeup_bitmask) const
{
void
FutexMap::suspend(Addr addr, uint64_t tgid, ThreadContext *tc)
{
- FutexKey key(addr, tgid);
- auto it = find(key);
-
- if (it == end()) {
- WaiterList waiterList {WaiterState(tc)};
- insert({key, waiterList});
- } else {
- it->second.push_back(WaiterState(tc));
- }
-
- /** Suspend the thread context */
- tc->suspend();
+ suspend_bitset(addr, tgid, tc, 0xffffffff);
}
int
*/
WaiterState(ThreadContext* _tc, int _bitmask);
- /**
- * if bitset is not defined, just set bitmask to 0xffffffff
- */
- WaiterState(ThreadContext* _tc);
-
/**
* return true if the bit-wise AND of the wakeup_bitmask given by
* a waking thread and this thread's internal bitmask is non-zero