8 class IPC_timeout : public Timeout
10 friend class Jdb_list_timeouts;
18 #include "thread_state.h"
21 * IPC_timeout constructor
24 IPC_timeout::IPC_timeout()
28 * IPC_timeout destructor
30 PUBLIC virtual inline NEEDS [IPC_timeout::owner, "receiver.h"]
31 IPC_timeout::~IPC_timeout()
33 owner()->set_timeout (0); // reset owner's timeout field
36 PRIVATE inline NEEDS ["globals.h"]
40 // We could have saved our context in our constructor, but computing
41 // it this way is easier and saves space. We can do this as we know
42 // that IPC_timeouts are always created on the kernel stack of the
45 return reinterpret_cast<Receiver *>(context_of (this));
49 * Timeout expiration callback function
50 * @return true if reschedule is necessary, false otherwise
54 IPC_timeout::expired()
56 Receiver * const _owner = owner();
58 Mword ipc_state = _owner->state() & Thread_ipc_mask;
59 if (!ipc_state || (ipc_state & Thread_receive_in_progress))
62 _owner->state_change_dirty(~Thread_ipc_mask, Thread_ready | Thread_timeout);
64 // Flag reschedule if owner's priority is higher than the current
65 // thread's (own or timeslice-donated) priority.
66 return Sched_context::rq.current().deblock(_owner->sched(), current()->sched(), false);