34 other.thread_ =
nullptr;
41 other.thread_ =
nullptr;
88 }
else if (timeout_microsec == 0) {
131 o <<
"ImpersonateSession: valid=" << v.
is_valid();
void release()
Releases all resources and ownerships this session has acquired.
ThreadTicket current_ticket_
The most recently issued impersonation ticket.
Idle state, receiving a new task.
ErrorStack get_result()
Waits until the completion of the asynchronous session and retrieves the result.
#define ERROR_STACK(e)
Instantiates ErrorStack with the given foedus::error_code, creating an error stack with the current f...
thread::ThreadRef * thread_
The impersonated thread.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
uint64_t get_output_size()
Returns the byte size of output.
Shared data of ThreadPimpl.
soc::SharedPolling task_complete_cond_
When the current task has been completed, the thread signals this.
void wait() const
Blocks until the completion of the asynchronous session.
A client has set a next task.
Brings error stacktrace information as return value of functions.
thread::ThreadTicket ticket_
The ticket issued as of impersonation.
A user session running on an impersonated thread.
uint64_t acquire_ticket() const
Gives the ticket to.
bool is_running() const
Returns if the task is still running.
ErrorStack to_error_stack() const
Instantiates an ErrorStack object based on this object.
const void * get_raw_output_buffer()
Returns the pointer to the raw output buffer on shared memory.
0x000A : "GENERAL: The session has expired." .
The thread has picked the task up and is now running.
bool is_valid() const
Returns if the impersonation succeeded.
void get_output(void *output_buffer)
Copies the output to the given buffer, whose size must be at least get_output_size().
ThreadControlBlock * get_control_block() const
bool wait_for(uint64_t timeout_microsec) const
Blocks until either the asynchronous session completes or the specified time elapses.
ImpersonateSession & operator=(const ImpersonateSession &other)=delete
ThreadStatus status_
Impersonation status of this thread.
std::ostream & operator<<(std::ostream &o, const ImpersonateSession &v)
void * get_task_output_memory() const
The thread has completed the task and set the result.
uint32_t output_len_
Byte size of output as the result of the procedure.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
FixedErrorStack proc_result_
Error code as the result of the procedure.
ThreadId get_thread_id() const
bool timedwait(uint64_t demanded_ticket, uint64_t timeout_microsec, uint64_t polling_spins=kDefaultPollingSpins, uint64_t max_interval_us=kDefaultPollingMaxIntervalUs) const
Wait for signal up to the given timeout.