本文整理汇总了C++中PROJECT::suspend方法的典型用法代码示例。如果您正苦于以下问题:C++ PROJECT::suspend方法的具体用法?C++ PROJECT::suspend怎么用?C++ PROJECT::suspend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PROJECT
的用法示例。
在下文中一共展示了PROJECT::suspend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_project_suspend
static void handle_project_suspend(GUI_RPC_CONN& grc) {
PROJECT* p = get_project_parse(grc);
if (!p) return;
gstate.set_client_state_dirty("Project modified by user");
msg_printf(p, MSG_INFO, "project suspended by user");
p->suspend();
grc.mfout.printf("<success/>\n");
}
示例2: handle_project_op
static void handle_project_op(char* buf, MIOFILE& fout, const char* op) {
PROJECT* p = get_project(buf, fout);
if (!p) {
fout.printf("<error>no such project</error>\n");
return;
}
gstate.set_client_state_dirty("Project modified by user");
if (!strcmp(op, "reset")) {
gstate.request_schedule_cpus("project reset by user");
gstate.request_work_fetch("project reset by user");
gstate.reset_project(p, false);
} else if (!strcmp(op, "suspend")) {
msg_printf(p, MSG_INFO, "suspended by user");
p->suspend();
} else if (!strcmp(op, "resume")) {
msg_printf(p, MSG_INFO, "resumed by user");
p->resume();
} else if (!strcmp(op, "detach")) {
if (p->attached_via_acct_mgr) {
msg_printf(p, MSG_INFO,
"This project must be detached using the account manager web site."
);
fout.printf("<error>must detach using account manager</error>");
return;
}
gstate.detach_project(p);
gstate.request_schedule_cpus("project detached by user");
gstate.request_work_fetch("project detached by user");
} else if (!strcmp(op, "update")) {
msg_printf(p, MSG_INFO, "update requested by user");
p->sched_rpc_pending = RPC_REASON_USER_REQ;
p->min_rpc_time = 0;
#if 1
rss_feeds.trigger_fetch(p);
#endif
gstate.request_work_fetch("project updated by user");
} else if (!strcmp(op, "nomorework")) {
msg_printf(p, MSG_INFO, "work fetch suspended by user");
p->dont_request_more_work = true;
} else if (!strcmp(op, "allowmorework")) {
msg_printf(p, MSG_INFO, "work fetch resumed by user");
p->dont_request_more_work = false;
gstate.request_work_fetch("project allowed to fetch work by user");
} else if (!strcmp(op, "detach_when_done")) {
msg_printf(p, MSG_INFO, "detach when done set by user");
p->detach_when_done = true;
p->dont_request_more_work = true;
} else if (!strcmp(op, "dont_detach_when_done")) {
msg_printf(p, MSG_INFO, "detach when done cleared by user");
p->detach_when_done = false;
p->dont_request_more_work = false;
}
fout.printf("<success/>\n");
}
示例3: handle_reply
//.........这里部分代码省略.........
if (pp->detach_when_done) {
pp->dont_request_more_work = true;
}
} else {
pp->detach_when_done = false;
}
// initiate a scheduler RPC if requested by AMS
//
if (acct.update) {
pp->sched_rpc_pending = RPC_REASON_ACCT_MGR_REQ;
pp->min_rpc_time = 0;
}
if (acct.resource_share.present) {
pp->ams_resource_share = acct.resource_share.value;
pp->resource_share = pp->ams_resource_share;
} else {
// no host-specific resource share;
// if currently have one, restore to value from web
//
if (pp->ams_resource_share >= 0) {
pp->ams_resource_share = -1;
PROJECT p2;
safe_strcpy(p2.master_url, pp->master_url);
retval = p2.parse_account_file();
if (!retval) {
pp->resource_share = p2.resource_share;
} else {
pp->resource_share = 100;
}
}
}
if (acct.suspend.present) {
if (acct.suspend.value) {
pp->suspend();
} else {
pp->resume();
}
}
if (acct.abort_not_started.present) {
if (acct.abort_not_started.value) {
pp->abort_not_started();
}
}
for (int j=0; j<MAX_RSC; j++) {
pp->no_rsc_ams[j] = acct.no_rsc[j];
}
}
} else {
// here we don't already have the project.
//
retval = check_string_signature2(
acct.url.c_str(), acct.url_signature, ami.signing_key, verified
);
if (retval || !verified) {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"Bad signature for URL %s", acct.url.c_str()
);
continue;
}
if (acct.authenticator.empty()) {
msg_printf(NULL, MSG_INFO,
"Account manager reply missing authenticator for %s",
acct.url.c_str()
);