Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ba5a250c
提交
ba5a250c
authored
9月 28, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
freetdm: stop scheduler but do not destroy it until the very end (dup)
上级
fb71965f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
29 行增加
和
11 行删除
+29
-11
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+8
-11
ftdm_sched.c
libs/freetdm/src/ftdm_sched.c
+18
-0
ftdm_sched.h
libs/freetdm/src/include/private/ftdm_sched.h
+3
-0
没有找到文件。
libs/freetdm/src/ftdm_io.c
浏览文件 @
ba5a250c
...
...
@@ -4932,16 +4932,19 @@ FT_DECLARE(uint32_t) ftdm_running(void)
FT_DECLARE
(
ftdm_status_t
)
ftdm_global_destroy
(
void
)
{
ftdm_span_t
*
sp
;
uint32_t
sanity
=
100
;
time_end
();
/* many freetdm event loops rely on this variable to decide when to stop, do this first */
globals
.
running
=
0
;
ftdm_sched_destroy
(
&
globals
.
timingsched
);
/* stop the scheduling thread */
ftdm_free_sched_stop
();
/* stop the cpu monitor thread */
ftdm_cpu_monitor_stop
();
/* now destroy channels and spans */
globals
.
span_index
=
0
;
ftdm_span_close_all
();
...
...
@@ -4966,18 +4969,12 @@ FT_DECLARE(ftdm_status_t) ftdm_global_destroy(void)
globals
.
spans
=
NULL
;
ftdm_mutex_unlock
(
globals
.
span_mutex
);
/* destroy signaling and io modules */
ftdm_unload_modules
();
while
(
ftdm_free_sched_running
()
&&
--
sanity
)
{
ftdm_log
(
FTDM_LOG_DEBUG
,
"Waiting for schedule thread to finish
\n
"
);
ftdm_sleep
(
100
);
}
if
(
!
sanity
)
{
ftdm_log
(
FTDM_LOG_CRIT
,
"schedule thread did not stop running, we may crash on shutdown
\n
"
);
}
/* finally destroy the globals */
ftdm_mutex_lock
(
globals
.
mutex
);
ftdm_sched_destroy
(
&
globals
.
timingsched
);
hashtable_destroy
(
globals
.
interface_hash
);
hashtable_destroy
(
globals
.
module_hash
);
hashtable_destroy
(
globals
.
span_hash
);
...
...
libs/freetdm/src/ftdm_sched.c
浏览文件 @
ba5a250c
...
...
@@ -176,6 +176,24 @@ FT_DECLARE(ftdm_bool_t) ftdm_free_sched_running(void)
return
sched_globals
.
running
;
}
FT_DECLARE
(
ftdm_bool_t
)
ftdm_free_sched_stop
(
void
)
{
/* currently we really dont stop the thread here, we rely on freetdm being shutdown and ftdm_running() to be false
* so the scheduling thread dies and we just wait for it here */
uint32_t
sanity
=
100
;
while
(
ftdm_free_sched_running
()
&&
--
sanity
)
{
ftdm_log
(
FTDM_LOG_DEBUG
,
"Waiting for main schedule thread to finish
\n
"
);
ftdm_sleep
(
100
);
}
if
(
!
sanity
)
{
ftdm_log
(
FTDM_LOG_CRIT
,
"schedule thread did not stop running, we may crash on shutdown
\n
"
);
return
FTDM_FALSE
;
}
return
FTDM_TRUE
;
}
FT_DECLARE
(
ftdm_status_t
)
ftdm_sched_create
(
ftdm_sched_t
**
sched
,
const
char
*
name
)
{
ftdm_sched_t
*
newsched
=
NULL
;
...
...
libs/freetdm/src/include/private/ftdm_sched.h
浏览文件 @
ba5a250c
...
...
@@ -95,6 +95,9 @@ FT_DECLARE(ftdm_status_t) ftdm_sched_global_init(void);
/*! \brief Checks if the main scheduling thread is running */
FT_DECLARE
(
ftdm_bool_t
)
ftdm_free_sched_running
(
void
);
/*! \brief Stop the main scheduling thread (if running) */
FT_DECLARE
(
ftdm_bool_t
)
ftdm_free_sched_stop
(
void
);
#ifdef __cplusplus
}
#endif
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论