Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
07ec7867
提交
07ec7867
authored
9月 17, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set conditionals to only fire when the mutex can be obtained
上级
d7c5cb2e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
5 行删除
+23
-5
mod_spandsp_fax.c
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+13
-3
switch_core_sqldb.c
src/switch_core_sqldb.c
+10
-2
没有找到文件。
src/mod/applications/mod_spandsp/mod_spandsp_fax.c
浏览文件 @
07ec7867
...
...
@@ -120,6 +120,16 @@ static struct {
int
thread_running
;
}
t38_state_list
;
static
void
wake_thread
(
void
)
{
if
(
switch_mutex_trylock
(
globals
.
cond_mutex
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_thread_cond_signal
(
globals
.
cond
);
switch_mutex_unlock
(
globals
.
cond_mutex
);
}
}
static
int
add_pvt
(
pvt_t
*
pvt
)
{
int
r
=
0
;
...
...
@@ -130,7 +140,7 @@ static int add_pvt(pvt_t *pvt)
t38_state_list
.
head
=
pvt
;
switch_mutex_unlock
(
t38_state_list
.
mutex
);
r
=
1
;
switch_thread_cond_broadcast
(
globals
.
cond
);
wake_thread
(
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Error launching thread
\n
"
);
}
...
...
@@ -165,7 +175,7 @@ static int del_pvt(pvt_t *del_pvt)
switch_mutex_unlock
(
t38_state_list
.
mutex
);
switch_thread_cond_broadcast
(
globals
.
cond
);
wake_thread
(
);
return
r
;
}
...
...
@@ -1335,7 +1345,7 @@ void mod_spandsp_fax_shutdown(void)
switch_status_t
tstatus
=
SWITCH_STATUS_SUCCESS
;
t38_state_list
.
thread_running
=
0
;
switch_thread_cond_broadcast
(
globals
.
cond
);
wake_thread
(
);
switch_thread_join
(
&
tstatus
,
t38_state_list
.
thread
);
memset
(
&
globals
,
0
,
sizeof
(
globals
));
}
...
...
src/switch_core_sqldb.c
浏览文件 @
07ec7867
...
...
@@ -464,6 +464,14 @@ static switch_status_t switch_cache_db_execute_sql_real(switch_cache_db_handle_t
return
status
;
}
static
void
wake_thread
(
void
)
{
if
(
switch_mutex_trylock
(
sql_manager
.
cond_mutex
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_thread_cond_signal
(
sql_manager
.
cond
);
switch_mutex_unlock
(
sql_manager
.
cond_mutex
);
}
}
/**
OMFG you cruel bastards. Who chooses 64k as a max buffer len for a sql statement, have you ever heard of transactions?
**/
...
...
@@ -1399,7 +1407,7 @@ static void core_event_handler(switch_event_t *event)
switch_queue_push
(
sql_manager
.
sql_queue
[
0
],
sql
[
i
]);
}
sql
[
i
]
=
NULL
;
switch_thread_cond_broadcast
(
sql_manager
.
cond
);
wake_thread
(
);
}
}
}
...
...
@@ -1673,7 +1681,7 @@ void switch_core_sqldb_stop(void)
switch_queue_push
(
sql_manager
.
sql_queue
[
0
],
NULL
);
switch_queue_push
(
sql_manager
.
sql_queue
[
1
],
NULL
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Waiting for unfinished SQL transactions
\n
"
);
switch_thread_cond_broadcast
(
sql_manager
.
cond
);
wake_thread
(
);
}
sql_manager
.
thread_running
=
-
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论