本文整理汇总了C++中end_allow_threads函数的典型用法代码示例。如果您正苦于以下问题:C++ end_allow_threads函数的具体用法?C++ end_allow_threads怎么用?C++ end_allow_threads使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了end_allow_threads函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SWITCH_DECLARE
SWITCH_DECLARE(int) CoreSession::streamFile(char *file, int starting_sample_count) {
switch_status_t status;
//switch_file_handle_t fh = { 0 };
const char *prebuf;
switch_file_handle_t local_fh;
this_check(-1);
sanity_check(-1);
memset(&local_fh, 0, sizeof(local_fh));
fhp = &local_fh;
local_fh.samples = starting_sample_count;
if ((prebuf = switch_channel_get_variable(this->channel, "stream_prebuffer"))) {
int maybe = atoi(prebuf);
if (maybe > 0) {
local_fh.prebuf = maybe;
}
}
begin_allow_threads();
status = switch_ivr_play_file(session, fhp, file, ap);
end_allow_threads();
fhp = NULL;
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
示例2: SWITCH_DECLARE
SWITCH_DECLARE(void) CoreSession::execute(const char *app, const char *data)
{
this_check_void();
sanity_check_noreturn;
if (zstr(app)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No application specified\n");
return;
}
begin_allow_threads();
switch_core_session_execute_application(session, app, data);
end_allow_threads();
}