您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ state_name函数代码示例

51自学网 2021-06-03 08:22:47
  C++
这篇教程C++ state_name函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中state_name函数的典型用法代码示例。如果您正苦于以下问题:C++ state_name函数的具体用法?C++ state_name怎么用?C++ state_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了state_name函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: print_status

void print_status(void) {	const char * const name = strtok(NULL,"/n");	if (NULL != name) {		const int number = atoi(name);		struct airhook_outgoing_status status;		if (0 == number || outgoing_count < number) {			fprintf(stderr,"%s: invalid message/n",name);			return;		}		status = airhook_outgoing_status(outgoing[number - 1]);		printf("data: %.*s/n",			status.data.end - status.data.begin,			status.data.begin);		printf("state: %s/n",state_name(status.state));		printf("transmit_count: %lu/n",status.transmit_count);		printf("last_change: %s/n",time_name(status.last_change));	} else {		struct airhook_status status = airhook_status(&socket);		if (status.session) 			printf("session: %08lx/n",status.session);		if (status.remote_session) 			printf("session: %08lx/n",status.remote_session);		printf("state: %s/n",state_name(status.state));		printf("remote_state: %s/n",state_name(status.remote_state));		printf("last_transmit: %s/n",time_name(status.last_transmit));		printf("next_transmit: %s/n",time_name(status.next_transmit));		printf("last_response: %s/n",time_name(status.last_response));	}}
开发者ID:wtanaka,项目名称:airhook,代码行数:30,


示例2: with

voidrust_sched_loop::transition(rust_task *task,                             rust_task_state src, rust_task_state dst,                             rust_cond *cond, const char* cond_name) {    scoped_lock with(lock);    DLOG(this, task,         "task %s " PTR " state change '%s' -> '%s' while in '%s'",         name, (uintptr_t)this, state_name(src), state_name(dst),         state_name(task->get_state()));    assert(task->get_state() == src);    rust_task_list *src_list = state_list(src);    if (src_list) {        src_list->remove(task);    }    rust_task_list *dst_list = state_list(dst);    if (dst_list) {        dst_list->append(task);    }    if (dst == task_state_dead) {        assert(dead_task == NULL);        dead_task = task;    }    task->set_state(dst, cond, cond_name);    // If the entire runtime is failing, newborn tasks must be doomed.    if (src == task_state_newborn && killed) {        task->kill_inner();    }    pump_loop();}
开发者ID:1100110,项目名称:rust,代码行数:31,


示例3: DSME_HANDLER

DSME_HANDLER(DSM_MSGTYPE_STATE_CHANGE_IND, server, msg){    if (state_replies) {        // there are yet unsent replies to state queries; sent the first one        GSList* first_node = state_replies;        DsmeDbusMessage* first_reply = (DsmeDbusMessage*)(first_node->data);        dsme_dbus_message_append_string(first_reply, state_name(msg->state));        dsme_dbus_signal_emit(first_reply); // deletes the reply        first_node->data = 0;        state_replies = g_slist_delete_link(state_replies, first_node);    } else {        // this is a broadcast state change        if (msg->state == DSME_STATE_SHUTDOWN ||            msg->state == DSME_STATE_ACTDEAD  ||            msg->state == DSME_STATE_REBOOT)        {            emit_dsme_dbus_signal(dsme_shutdown_ind);        }        DsmeDbusMessage* sig = dsme_dbus_signal_new(sig_path,                                                    sig_interface,                                                    dsme_state_change_ind);        dsme_dbus_message_append_string(sig, state_name(msg->state));        dsme_dbus_signal_emit(sig);    }}
开发者ID:kimmoli,项目名称:dsme,代码行数:26,


示例4: dcethread__change_state

voiddcethread__change_state(dcethread* thread, int state){    DCETHREAD_TRACE("Thread %p: state transition %s -> %s",		thread,		state_name(thread->state),		state_name(state));    thread->state = state;    pthread_cond_broadcast((pthread_cond_t*) &thread->state_change);}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:10,


示例5: measure

static void measure(int fd){    time_t start_time;    int last_state;    time_t last_time;    int curr_state;    time_t curr_time = 0;    time_t time_diff;    time_t active_time = 0;    time_t sleep_time = 0;    time_t unknown_time = 0;    time_t total_time = 0;    int changes = 0;    float tmp;    printf("Starting measurements/n");    last_state = check_powermode(fd);    start_time = last_time = time(0);    printf("  System is in state %s/n/n", state_name(last_state));    while(!endit) {	sleep(1);	curr_state = check_powermode(fd);	if (curr_state != last_state || endit) {	    changes++;	    curr_time = time(0);	    time_diff = curr_time - last_time;	    if (last_state == 1) active_time += time_diff;	    else if (last_state == 0) sleep_time += time_diff;	    else unknown_time += time_diff;	    last_state = curr_state;	    last_time = curr_time;	    printf("%s: State-change to %s/n", myctime(curr_time),		   state_name(curr_state));	}    }    changes--; /* Compensate for SIGINT */    total_time = time(0) - start_time;    printf("/nTotal running time:  %lus/n", curr_time - start_time);    printf(" State changed %d times/n", changes);    tmp = (float)sleep_time / (float)total_time * 100;    printf(" Time in sleep state:   %lus (%.2f%%)/n", sleep_time, tmp);    tmp = (float)active_time / (float)total_time * 100;    printf(" Time in active state:  %lus (%.2f%%)/n", active_time, tmp);    tmp = (float)unknown_time / (float)total_time * 100;    printf(" Time in unknown state: %lus (%.2f%%)/n", unknown_time, tmp);}
开发者ID:BinVul,项目名称:linux2.6.32,代码行数:54,


示例6: trace_state_change

static inline voidtrace_state_change (const char *transition, MonoThreadInfo *info, int cur_raw_state, int next_state, int suspend_count_delta){	check_thread_state (info);	THREADS_STATE_MACHINE_DEBUG ("[%s][%p] %s -> %s (%d -> %d)/n",		transition,		mono_thread_info_get_tid (info),		state_name (get_thread_state (cur_raw_state)),		state_name (next_state),		get_thread_suspend_count (cur_raw_state),		get_thread_suspend_count (cur_raw_state) + suspend_count_delta);}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:12,


示例7: ensure_valid_state

		void		ensure_valid_state(			state_t expected_state ) const		{			if( m_state != expected_state )			{				std::cerr << "expected and actual states mismatch! "							"current state: "						<< state_name( m_state ) << " expected state: "						<< state_name( expected_state );				std::abort();			}		}
开发者ID:DronMDF,项目名称:SObjectizer,代码行数:14,


示例8: log_debug

void machine_t::process_transition_queue(){  if(transition_in_progress())  {    log_debug("process_transition_queue() is already in progress, returning") ;    return ; // never do it recursively  }  // log_debug("begin processing, states: %s tqueue: %s" , s_states().c_str(), s_transition_queue().c_str()) ;  transition_start_time = ticker_t(now()) ;  bool queue_changed = false ;  for(; not transition_queue.empty(); queue_changed = true, transition_queue.pop_front())  {#define state_name(p) (p?p->name():"null")    event_t *e = transition_queue.front().first ;    abstract_state_t *new_state = transition_queue.front().second ;    if (not is_event_registered(e))    {      log_error("requested to move destroyed event %p to state '%s'", e, state_name(new_state)) ;      continue ;    }    abstract_state_t *old_state = e->get_state() ;    log_notice("State transition %d:'%s'->'%s'", e->cookie.value(), state_name(old_state), state_name(new_state)) ;    if (new_state==old_state)      log_critical("Event %d: new_state=old_state='%s'", e->cookie.value(), old_state->name()) ;#undef state_name    if(old_state)      old_state->leave(e) ;    e->set_state(new_state) ;    if(new_state)    {      new_state->enter(e) ;      e->sort_and_run_actions(new_state->get_action_mask()) ;    }    else    {      log_notice("Destroying the event %u (event object %p)", e->cookie.value(), e) ;      unregister_event(e) ;      delete e ;    }  }  // log_debug("processing done,  states: %s tqueue: %s" , s_states().c_str(), s_transition_queue().c_str()) ;  transition_start_time = ticker_t(0) ;  transition_time_adjustment.set(0) ;  if(queue_changed)    emit queue_to_be_saved() ;  if(context_changed)    send_queue_context() ;  send_bootup_signal() ;}
开发者ID:deztructor,项目名称:timed,代码行数:49,


示例9: trace_state_change_with_func

static inline voidtrace_state_change_with_func (const char *transition, MonoThreadInfo *info, int cur_raw_state, int next_state, int suspend_count_delta, const char *func){	check_thread_state (info);	THREADS_STATE_MACHINE_DEBUG ("[%s][%p] %s -> %s (%d -> %d) %s/n",		transition,		mono_thread_info_get_tid (info),		state_name (get_thread_state (cur_raw_state)),		state_name (next_state),		get_thread_suspend_count (cur_raw_state),		get_thread_suspend_count (cur_raw_state) + suspend_count_delta,		func);	CHECKED_BUILD_THREAD_TRANSITION (transition, info, get_thread_state (cur_raw_state), get_thread_suspend_count (cur_raw_state), next_state, suspend_count_delta);}
开发者ID:mhutch,项目名称:mono,代码行数:15,


示例10: otg_init

static int otg_init(struct isp1301 *isp){	if (!otg_dev)		return -ENODEV;	dump_regs(isp, __func__);	/* some of these values are board-specific... */	OTG_SYSCON_2_REG |= OTG_EN		/* for B-device: */		| SRP_GPDATA		/* 9msec Bdev D+ pulse */		| SRP_GPDVBUS		/* discharge after VBUS pulse */		// | (3 << 24)		/* 2msec VBUS pulse */		/* for A-device: */		| (0 << 20)		/* 200ms nominal A_WAIT_VRISE timer */		| SRP_DPW		/* detect 167+ns SRP pulses */		| SRP_DATA | SRP_VBUS	/* accept both kinds of SRP pulse */		;	update_otg1(isp, isp1301_get_u8(isp, ISP1301_INTERRUPT_SOURCE));	update_otg2(isp, isp1301_get_u8(isp, ISP1301_OTG_STATUS));	check_state(isp, __func__);	pr_debug("otg: %s, %s %06x/n",			state_name(isp), __func__, OTG_CTRL_REG);	OTG_IRQ_EN_REG = DRIVER_SWITCH | OPRT_CHG			| B_SRP_TMROUT | B_HNP_FAIL			| A_VBUS_ERR | A_SRP_DETECT | A_REQ_TMROUT;	OTG_SYSCON_2_REG |= OTG_EN;	return 0;}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:32,


示例11: peer_show

/*	diagnostic code*/void peer_show(){	int i;	__u16 * pp;	__u8 * p8;	char tbuf[64];	ktime_t t;		printf("Mode=%s,state=%s,flags=%08x,peermode=%s,%s./n", ke_get_mode_name(kernelState), 		state_name(get_state()), g_kernel.status.flags, ke_get_mode_name(peerState),		ke_get_flag(FKERN_LED_SYNCHRONIZED)? "Synchronized":"Out of sync");	pp=(__u16*)&g_kernel.status.prog_id;	printf("  version : %04x-%04x-%04x-%04x/n", pp[0], pp[1], pp[2], pp[3]);	pp=(__u16*)&g_kernel.peer_status.prog_id;	printf("p-version : %04x-%04x-%04x-%04x/n", pp[0], pp[1], pp[2], pp[3]);	p8=(__u8*)g_kernel.peer->localAddress;	printf("Local addr: %02x-%02x-%02x-%02x-%02x-%02x/n",p8[0],p8[1],p8[2],p8[3],p8[4],p8[5]);	p8=(__u8*)g_kernel.peer->peerAddress;	printf("Peer addr : %02x-%02x-%02x-%02x-%02x-%02x/n",p8[0],p8[1],p8[2],p8[3],p8[4],p8[5]);	t=ke_get_time();	ke_time_to_string(t,tbuf,sizeof(tbuf));	printf("Local time: %s/n",tbuf);	ke_time_to_string(t+hspTimeOffset,tbuf,sizeof(tbuf));	printf("Peer time : %s/n",tbuf);	printf("Time Bias : %d milliseconds/n",hspTimeOffset/10/1000);	printf("Counters  : ");	for(i=0; i<sizeof peerCounters/sizeof peerCounters[0]; i++){		printf("%d=%d,", i, peerCounters[i]);	}	printf("/n");	ke_time_to_string(g_kernel.peer->lastMsgTime,tbuf,sizeof(tbuf));	printf("Last msg from peer arrived at : %s/n",tbuf);}
开发者ID:eseawind,项目名称:CNCS_PMC-Conductor,代码行数:36,


示例12: mono_threads_transition_do_blocking

/*This transitions the thread into a cooperative state where it's assumed to be suspended but can continue.Native runtime code might want to put itself into a state where the thread is considered suspended but can keep running.That state only works as long as the only managed state touched is blitable and was pinned before the transition.It returns the action the caller must perform:- Continue: Entered blocking state sucessfully;- PollAndRetry: Async suspend raced and won, try to suspend and then retry;*/MonoDoBlockingResultmono_threads_transition_do_blocking (MonoThreadInfo* info){	int raw_state, cur_state, suspend_count;retry_state_change:	UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);	switch (cur_state) {	case STATE_RUNNING: //transition to blocked		g_assert (suspend_count == 0);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_BLOCKING, suspend_count), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("DO_BLOCKING", info, raw_state, STATE_BLOCKING, 0);		return DoBlockingContinue;	case STATE_ASYNC_SUSPEND_REQUESTED:		g_assert (suspend_count > 0);		trace_state_change ("DO_BLOCKING", info, raw_state, cur_state, 0);		return DoBlockingPollAndRetry;/*STATE_ASYNC_SUSPENDEDSTATE_SELF_SUSPENDED: Code should not be running while suspended.STATE_SELF_SUSPEND_REQUESTED: A blocking operation must not be done while trying to self suspendSTATE_BLOCKING:STATE_BLOCKING_AND_SUSPENDED: Blocking is not nestabled*/	default:		g_error ("Cannot transition thread %p from %s with DO_BLOCKING", info, state_name (cur_state));	}}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:43,


示例13: mono_threads_transition_finish_async_suspend

/*This performs the last step of async suspend.Returns TRUE if the caller should wait for resume.*/gbooleanmono_threads_transition_finish_async_suspend (MonoThreadInfo* info){	int raw_state, cur_state, suspend_count;retry_state_change:	UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);	switch (cur_state) {	case STATE_SELF_SUSPENDED: //async suspend raced with self suspend and lost	case STATE_BLOCKING_AND_SUSPENDED: //async suspend raced with blocking and lost		trace_state_change ("FINISH_ASYNC_SUSPEND", info, raw_state, cur_state, 0);		return FALSE; //let self suspend wait	case STATE_ASYNC_SUSPEND_REQUESTED:		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_ASYNC_SUSPENDED, suspend_count), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("FINISH_ASYNC_SUSPEND", info, raw_state, STATE_ASYNC_SUSPENDED, 0);		return TRUE; //Async suspend worked, now wait for resume/*STATE_RUNNING: A thread cannot escape suspension once requested.STATE_ASYNC_SUSPENDED: There can be only one suspend initiator at a given time, meaning this state should have been visible on the first stage of suspend.STATE_SELF_SUSPEND_REQUESTED: When self suspend and async suspend happen together, they converge to async suspend so this state should not be visible.STATE_BLOCKING: Async suspend only begins if a transition to async suspend requested happened. Blocking would have put us into blocking with positive suspend count if it raced with async finish.*/	default:		g_error ("Cannot transition thread %p from %s with FINISH_ASYNC_SUSPEND", info, state_name (cur_state));	}}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:35,


示例14: mono_threads_transition_state_poll

/*Check the current state of the thread and try to init a self suspend.This must be called with self state saved.Returns one of the following values:- Resumed: Async resume happened and current thread should keep running- Suspend: Caller should wait for a resume signal- SelfSuspendNotifyAndWait: Notify the suspend initiator and wait for a resume signals suspend should start.*/MonoSelfSupendResultmono_threads_transition_state_poll (MonoThreadInfo *info){	int raw_state, cur_state, suspend_count;	g_assert (info == mono_thread_info_current ());retry_state_change:	UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);	switch (cur_state) {	case STATE_RUNNING:		g_assert (suspend_count == 0);		trace_state_change ("STATE_POLL", info, raw_state, cur_state, 0);		return SelfSuspendResumed; //We're fine, don't suspend	case STATE_ASYNC_SUSPEND_REQUESTED: //Async suspend requested, service it with a self suspend	case STATE_SELF_SUSPEND_REQUESTED: //Start the self suspend process		g_assert (suspend_count > 0);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_SELF_SUSPENDED, suspend_count), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("STATE_POLL", info, raw_state, STATE_SELF_SUSPENDED, 0);		if (cur_state == STATE_SELF_SUSPEND_REQUESTED)			return SelfSuspendWait; //Caller should wait for resume		else			return SelfSuspendNotifyAndWait; //Caller should notify suspend initiator and wait for resume/*STATE_ASYNC_SUSPENDED: Code should not be running while suspended.STATE_SELF_SUSPENDED: Code should not be running while suspended.STATE_BLOCKING:STATE_BLOCKING_AND_SUSPENDED: Pool is a local state transition. No VM activities are allowed while in blocking mode.*/	default:		g_error ("Cannot transition thread %p from %s with STATE_POLL", info, state_name (cur_state));	}}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:47,


示例15: handle_session_event

static void handle_session_event(WSPMachine *sm, WAPEvent *current_event, WSP_PDU *pdu) {	debug("wap.wsp", 0, "WSP: machine %p, state %s, event %s",		(void *) sm,		state_name(sm->state), 		wap_event_name(current_event->type));	#define STATE_NAME(name)	#define ROW(state_name, event, condition, action, next_state) /		{ /			struct event *e; /			e = &current_event->u.event; /			if (sm->state == state_name && /			   current_event->type == event && /			   (condition)) { /				action /				sm->state = next_state; /				debug("wap.wsp", 0, "WSP %ld: New state %s", /					sm->session_id, #next_state); /				goto end; /			} /		}	#include "wsp_server_session_states.def"		cant_handle_event(sm, current_event);end:	wap_event_destroy(current_event);	if (sm->state == NULL_SESSION)		machine_destroy(sm);}
开发者ID:gburiticato,项目名称:kannel,代码行数:32,


示例16: call_debug

int call_debug(struct re_printf *pf, const struct call *call){	int err;	if (!call)		return 0;	err = re_hprintf(pf, "===== Call debug (%s) =====/n",			 state_name(call->state));	/* SIP Session debug */	err |= re_hprintf(pf,			  " local_uri: %s <%s>/n"			  " peer_uri:  %s <%s>/n"			  " af=%s/n",			  call->local_name, call->local_uri,			  call->peer_name, call->peer_uri,			  net_af2name(call->af));	err |= re_hprintf(pf, " direction: %s/n",			  call->outgoing ? "Outgoing" : "Incoming");	/* SDP debug */	err |= sdp_session_debug(pf, call->sdp);	return err;}
开发者ID:sealaunch,项目名称:baresip,代码行数:26,


示例17: mono_threads_transition_detach

/*This is the transition that signals that a thread is no longer registered with the runtime.Its main goal is to catch threads been witnessed after they detach.This returns TRUE is the transition succeeded.If it returns false it means that there's a pending suspend that should be acted upon.*/gbooleanmono_threads_transition_detach (MonoThreadInfo *info){	int raw_state, cur_state, suspend_count;retry_state_change:	UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);	switch (cur_state) {	case STATE_RUNNING:		g_assert (suspend_count == 0);		if (InterlockedCompareExchange (&info->thread_state, STATE_DETACHED, raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("DETACH", info, raw_state, STATE_DETACHED, 0);		return TRUE;	case STATE_ASYNC_SUSPEND_REQUESTED: //Can't detach until whoever asked us to suspend to be happy with us		return FALSE;/*STATE_ASYNC_SUSPENDED: Code should not be running while suspended.STATE_SELF_SUSPENDED: Code should not be running while suspended.STATE_SELF_SUSPEND_REQUESTED: This is a bug in the self suspend code that didn't execute the second part of itSTATE_BLOCKING: This is a bug in the coop code that forgot to do a finish blocking before exiting.STATE_BLOCKING_AND_SUSPENDED: This is a bug in coop x suspend that resulted the thread in an undetachable state.*/	default:		g_error ("Cannot transition current thread %p from %s with DETACH", info, state_name (cur_state));	}}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:34,


示例18: isp1301_start_srp

static intisp1301_start_srp(struct otg_transceiver *dev){	struct isp1301	*isp = container_of(dev, struct isp1301, otg);	u32		otg_ctrl;	if (!dev || isp != the_transceiver			|| isp->otg.state != OTG_STATE_B_IDLE)		return -ENODEV;	otg_ctrl = omap_readl(OTG_CTRL);	if (!(otg_ctrl & OTG_BSESSEND))		return -EINVAL;	otg_ctrl |= OTG_B_BUSREQ;	otg_ctrl &= ~OTG_A_BUSREQ & OTG_CTRL_MASK;	omap_writel(otg_ctrl, OTG_CTRL);	isp->otg.state = OTG_STATE_B_SRP_INIT;	pr_debug("otg: SRP, %s ... %06x/n", state_name(isp),			omap_readl(OTG_CTRL));#ifdef	CONFIG_USB_OTG	check_state(isp, __func__);#endif	return 0;}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:26,


示例19: call_info

int call_info(struct re_printf *pf, const struct call *call){	if (!call)		return 0;	return re_hprintf(pf, "%H  %8s  %s", print_duration, call,			  state_name(call->state), call->peer_uri);}
开发者ID:aKlausKranz,项目名称:baresip,代码行数:8,


示例20: DSME_HANDLER

DSME_HANDLER(DSM_MSGTYPE_STATE_CHANGE_IND, conn, msg){    write_log("Received: dsme internal state", state_name(msg->state));    if (saved_shutdown_reason == SD_REASON_UNKNOWN) {        if (msg->state == DSME_STATE_SHUTDOWN)            saved_shutdown_reason = SD_SW_SHUTDOWN;        else if (msg->state == DSME_STATE_REBOOT)            saved_shutdown_reason = SD_SW_REBOOT;    }}
开发者ID:faenil,项目名称:dsme,代码行数:10,


示例21: DSME_HANDLER

DSME_HANDLER(DSM_MSGTYPE_STATE_QUERY, client, msg){  DSM_MSGTYPE_STATE_CHANGE_IND ind_msg =    DSME_MSG_INIT(DSM_MSGTYPE_STATE_CHANGE_IND);  dsme_log(LOG_DEBUG, PFIX"state_query, state: %s", state_name(current_state));  ind_msg.state = current_state;  endpoint_send(client, &ind_msg);}
开发者ID:philippedeswert,项目名称:dsme,代码行数:10,


示例22: get_exception

    HPX_EXPORT std::exception_ptr    get_exception(Exception const& e, std::string const& func,        std::string const& file, long line, std::string const& auxinfo)    {        if (is_of_lightweight_hpx_category(e))            return construct_lightweight_exception(e, func, file, line);        std::int64_t pid = ::getpid();        std::string back_trace(backtrace());        std::string state_name("not running");        std::string hostname;        hpx::runtime* rt = get_runtime_ptr();        if (rt)        {            state rts_state = rt->get_state();            state_name = get_runtime_state_name(rts_state);            if (rts_state >= state_initialized &&                rts_state < state_stopped)            {                std::ostringstream strm;                strm << get_runtime().here();                hostname = strm.str();            }        }        // if this is not a HPX thread we do not need to query neither for        // the shepherd thread nor for the thread id        error_code ec(lightweight);        std::uint32_t node = get_locality_id(ec);        std::size_t shepherd = std::size_t(-1);        threads::thread_id_type thread_id;        util::thread_description thread_name;        threads::thread_self* self = threads::get_self_ptr();        if (nullptr != self)        {            if (threads::threadmanager_is(state_running))                shepherd = hpx::get_worker_thread_num();            thread_id = threads::get_self_id();            thread_name = threads::get_thread_description(thread_id);        }        std::string env(get_execution_environment());        std::string config(configuration_string());        return construct_exception(e, func, file, line, back_trace, node,            hostname, pid, shepherd,            reinterpret_cast<std::size_t>(thread_id.get()),            util::as_string(thread_name), env, config,            state_name, auxinfo);    }
开发者ID:ShmuelLevine,项目名称:hpx,代码行数:55,


示例23: state_machine

static void state_machine(MSBitrateController *obj){	MSRateControlAction action = {0};	switch(obj->state){		case Stable:			obj->stable_count++;		case Init:			ms_qos_analyzer_suggest_action(obj->analyzer,&action);			if (action.type!=MSRateControlActionDoNothing){				execute_action(obj,&action);				obj->state=Probing;			}else if (obj->stable_count>=probing_up_interval){				action.type=MSRateControlActionIncreaseQuality;				action.value=10;				execute_action(obj,&action);				obj->state=ProbingUp;				obj->probing_up_count=0;			}		break;		case Probing:			obj->stable_count=0;			if (ms_qos_analyzer_has_improved(obj->analyzer)){				obj->state=Stable;			}else{				ms_qos_analyzer_suggest_action(obj->analyzer,&action);				if (action.type!=MSRateControlActionDoNothing){					execute_action(obj,&action);				}			}		break;		case ProbingUp:			obj->stable_count=0;			obj->probing_up_count++;			ms_qos_analyzer_suggest_action(obj->analyzer,&action);			if (action.type!=MSRateControlActionDoNothing){				execute_action(obj,&action);				obj->state=Probing;			}else{				/*continue with slow ramp up*/				if (obj->probing_up_count==2){					action.type=MSRateControlActionIncreaseQuality;					action.value=10;					if (execute_action(obj,&action)==-1){						/* we reached the maximum*/						obj->state=Init;					}					obj->probing_up_count=0;				}			}		break;		default:		break;	}	ms_message("MSBitrateController: current state is %s",state_name(obj->state));}
开发者ID:Accontech,项目名称:mediastreamer2,代码行数:54,


示例24: dump_regs

static voiddump_regs(struct isp1301 *isp, const char *label){	u8	ctrl = isp1301_get_u8(isp, ISP1301_OTG_CONTROL_1);	u8	status = isp1301_get_u8(isp, ISP1301_OTG_STATUS);	u8	src = isp1301_get_u8(isp, ISP1301_INTERRUPT_SOURCE);	pr_debug("otg: %06x, %s %s, otg/%02x stat/%02x.%02x/n",		omap_readl(OTG_CTRL), label, state_name(isp),		ctrl, status, src);	/* mode control and irq enables don't change much */}
开发者ID:7799,项目名称:linux,代码行数:12,


示例25: isp1301_start_hnp

static intisp1301_start_hnp(struct otg_transceiver *dev){#ifdef	CONFIG_USB_OTG	struct isp1301	*isp = container_of(dev, struct isp1301, otg);	u32 l;	if (!dev || isp != the_transceiver)		return -ENODEV;	if (isp->otg.default_a && (isp->otg.host == NULL			|| !isp->otg.host->b_hnp_enable))		return -ENOTCONN;	if (!isp->otg.default_a && (isp->otg.gadget == NULL			|| !isp->otg.gadget->b_hnp_enable))		return -ENOTCONN;	/* We want hardware to manage most HNP protocol timings.	 * So do this part as early as possible...	 */	switch (isp->otg.state) {	case OTG_STATE_B_HOST:		isp->otg.state = OTG_STATE_B_PERIPHERAL;		/* caller will suspend next */		break;	case OTG_STATE_A_HOST:#if 0		/* autoconnect mode avoids irq latency bugs */		isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1,				MC1_BDIS_ACON_EN);#endif		/* caller must suspend then clear A_BUSREQ */		usb_gadget_vbus_connect(isp->otg.gadget);		l = omap_readl(OTG_CTRL);		l |= OTG_A_SETB_HNPEN;		omap_writel(l, OTG_CTRL);		break;	case OTG_STATE_A_PERIPHERAL:		/* initiated by B-Host suspend */		break;	default:		return -EILSEQ;	}	pr_debug("otg: HNP %s, %06x .../n",		state_name(isp), omap_readl(OTG_CTRL));	check_state(isp, __func__);	return 0;#else	/* srp-only */	return -EINVAL;#endif}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:52,


示例26: mono_threads_transition_request_async_suspension

/*This transition initiates the suspension of another thread.Returns one of the following values:- AsyncSuspendInitSuspend: Thread suspend requested, async suspend needs to be done.- AsyncSuspendAlreadySuspended: Thread already suspended, nothing to do.- AsyncSuspendWait: Self suspend in progress, asked it to notify us. Caller must add target to the notification set.*/MonoRequestAsyncSuspendResultmono_threads_transition_request_async_suspension (MonoThreadInfo *info){	int raw_state, cur_state, suspend_count;	g_assert (info != mono_thread_info_current ());retry_state_change:	UNWRAP_THREAD_STATE (raw_state, cur_state, suspend_count, info);	switch (cur_state) {	case STATE_RUNNING: //Post an async suspend request		g_assert (suspend_count == 0);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_ASYNC_SUSPEND_REQUESTED, 1), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("ASYNC_SUSPEND_REQUESTED", info, raw_state, STATE_ASYNC_SUSPEND_REQUESTED, 1);		return AsyncSuspendInitSuspend; //This is the first async suspend request against the target	case STATE_ASYNC_SUSPENDED:	case STATE_SELF_SUSPENDED: //Async suspend can suspend the same thread multiple times as it starts from the outside	case STATE_BLOCKING_AND_SUSPENDED:		g_assert (suspend_count > 0 && suspend_count < THREAD_SUSPEND_COUNT_MAX);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (cur_state, suspend_count + 1), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("ASYNC_SUSPEND_REQUESTED", info, raw_state, cur_state, 1);		return AsyncSuspendAlreadySuspended; //Thread is already suspended so we don't need to wait it to suspend	case STATE_SELF_SUSPEND_REQUESTED: //This suspend needs to notify the initiator, so we need to promote the suspend to async		g_assert (suspend_count > 0 && suspend_count < THREAD_SUSPEND_COUNT_MAX);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (STATE_ASYNC_SUSPEND_REQUESTED, suspend_count + 1), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("ASYNC_SUSPEND_REQUESTED", info, raw_state, STATE_ASYNC_SUSPEND_REQUESTED, 1);		return AsyncSuspendWait; //This is the first async suspend request, change the thread and let it notify us [1]	case STATE_BLOCKING:		g_assert (suspend_count < THREAD_SUSPEND_COUNT_MAX);		if (InterlockedCompareExchange (&info->thread_state, build_thread_state (cur_state, suspend_count + 1), raw_state) != raw_state)			goto retry_state_change;		trace_state_change ("ASYNC_SUSPEND_REQUESTED", info, raw_state, cur_state, 1);		return AsyncSuspendAlreadySuspended; //A thread in the blocking state has its state saved so we can treat it as suspended./*[1] It's questionable on what to do if we hit the beginning of a self suspend.The expected behavior is that the target should poll its state very soon so the the suspend latency should be minimal.STATE_ASYNC_SUSPEND_REQUESTED: Since there can only be one async suspend in progress and it must finish, it should not be possible to witness this.*/	default:		g_error ("Cannot transition thread %p from %s with ASYNC_SUSPEND_REQUESTED", info, state_name (cur_state));	}	return FALSE;}
开发者ID:Forcom-Perspectiv,项目名称:mono,代码行数:61,


示例27: StateApply

void Player::StateApply(const char* name_, int turn_){	for(list<state_name>::iterator it=state_list.begin();it!=state_list.end();it++)	{		if(!it->name.compare(name_))		{			if(it->turn < turn_)				it->turn  = turn_;			return;		}	}	state_list.push_back(state_name(name_,turn_));}
开发者ID:seobyeongky,项目名称:gunscape,代码行数:13,


示例28: write_all_states

static voidwrite_all_states(unsigned int states){	unsigned int lowbit;	/* A trick for computing the lowest set bit. */	while ((lowbit = states & (-states)) != 0) {		states &= ~lowbit;		/* Clear the low bit. */		errmsg(state_name(lowbit));		if (states != 0)			errmsg("/");	}}
开发者ID:Tarsnap,项目名称:tarsnap,代码行数:13,


示例29: _set_state

void _set_state(enum hsp_state_t s,const char * fnc, int line){	if(s == _state){		return;	}#if defined(HSP_DEBUG)	{		ktime_t t;		t = ke_get_time() - tBase;		hsp_log(("%d, state change %s->%s, file %s,line %d/n", (int)(t/10000),state_name(_state),state_name(s),fnc,line));	}#endif	_state = s;}
开发者ID:eseawind,项目名称:CNCS_PMC-Conductor,代码行数:14,


示例30: change_state

/** * This function sends a message to clients to notify about state change. * SAVE_DATA message is also sent when going down. * @param state State that is being activated */static void change_state(dsme_state_t new_state){  if (new_state == DSME_STATE_SHUTDOWN ||      new_state == DSME_STATE_ACTDEAD  ||       new_state == DSME_STATE_REBOOT)  {      DSM_MSGTYPE_SAVE_DATA_IND save_msg =        DSME_MSG_INIT(DSM_MSGTYPE_SAVE_DATA_IND);      dsme_log(LOG_DEBUG, PFIX"sending SAVE_DATA");      broadcast(&save_msg);  }  DSM_MSGTYPE_STATE_CHANGE_IND ind_msg =    DSME_MSG_INIT(DSM_MSGTYPE_STATE_CHANGE_IND);  ind_msg.state = new_state;  dsme_log(LOG_DEBUG, PFIX"STATE_CHANGE_IND sent (%s)", state_name(new_state));  broadcast(&ind_msg);  dsme_log(LOG_NOTICE, PFIX"new state: %s", state_name(new_state));  current_state = new_state;}
开发者ID:philippedeswert,项目名称:dsme,代码行数:28,



注:本文中的state_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ state_save_register_global函数代码示例
C++ state_add函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。