本文整理汇总了C++中Exception::nil_p方法的典型用法代码示例。如果您正苦于以下问题:C++ Exception::nil_p方法的具体用法?C++ Exception::nil_p怎么用?C++ Exception::nil_p使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exception
的用法示例。
在下文中一共展示了Exception::nil_p方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process_async
bool State::process_async(CallFrame* call_frame) {
set_call_frame(call_frame);
vm_->clear_check_local_interrupts();
if(vm_->run_signals_) {
if(!vm_->shared.signal_handler()->deliver_signals(this, call_frame)) {
return false;
}
}
Exception* exc = vm_->interrupted_exception_.get();
if(!exc->nil_p()) {
vm_->interrupted_exception_.set(nil<Exception>());
// Only write the locations if there are none.
if(exc->locations()->nil_p() || exc->locations()->size() == 0) {
exc->locations(this, Location::from_call_stack(this, call_frame));
}
vm_->thread_state_.raise_exception(exc);
return false;
}
if(vm_->interrupt_by_kill()) {
vm_->clear_interrupt_by_kill();
vm_->thread_state_.raise_thread_kill();
return false;
}
return true;
}
示例2: check_thread_raise_or_kill
bool VM::check_thread_raise_or_kill(STATE) {
Exception* exc = interrupted_exception();
if(!exc->nil_p()) {
clear_interrupted_exception();
// Only write the locations if there are none.
if(exc->locations()->nil_p() || exc->locations()->size() == 0) {
exc->locations(this, Location::from_call_stack(state));
}
thread_state_.raise_exception(exc);
return true;
}
if(interrupt_by_kill()) {
Fiber* fib = current_fiber.get();
if(fib->nil_p() || fib->root_p()) {
clear_interrupt_by_kill();
} else {
set_check_local_interrupts();
}
thread_state_.raise_thread_kill();
return true;
}
// If the current thread is trying to step, debugger wise, then assist!
if(thread_step()) {
clear_thread_step();
if(!Helpers::yield_debugger(state, cNil)) return true;
}
return false;
}