Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
72e49dc7
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 9 个月
通知
994
Star
71100
Fork
55581
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
72e49dc7
编写于
4月 05, 2013
作者:
A
Andrey Kamaev
提交者:
OpenCV Buildbot
4月 05, 2013
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #777 from taka-no-me:ocl_win_hang
上级
a2d27429
3400d837
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
4 deletion
+11
-4
modules/ocl/src/initialization.cpp
modules/ocl/src/initialization.cpp
+11
-4
未找到文件。
modules/ocl/src/initialization.cpp
浏览文件 @
72e49dc7
...
...
@@ -913,6 +913,7 @@ namespace cv
auto_ptr
<
Context
>
Context
::
clCxt
;
int
Context
::
val
=
0
;
static
Mutex
cs
;
static
volatile
int
context_tear_down
=
0
;
Context
*
Context
::
getContext
()
{
if
(
*
((
volatile
int
*
)
&
val
)
!=
1
)
...
...
@@ -920,9 +921,10 @@ namespace cv
AutoLock
al
(
cs
);
if
(
*
((
volatile
int
*
)
&
val
)
!=
1
)
{
if
(
context_tear_down
)
return
clCxt
.
get
();
if
(
0
==
clCxt
.
get
())
clCxt
.
reset
(
new
Context
);
std
::
vector
<
Info
>
oclinfo
;
CV_Assert
(
getDevice
(
oclinfo
,
CVCL_DEVICE_TYPE_ALL
)
>
0
);
oclinfo
[
0
].
impl
->
setDevice
(
0
,
0
,
0
);
...
...
@@ -1045,9 +1047,14 @@ BOOL WINAPI DllMain( HINSTANCE, DWORD fdwReason, LPVOID )
{
// application hangs if call clReleaseCommandQueue here, so release context only
// without context release application hangs as well
cl_context
ctx
=
(
cl_context
)
getoclContext
();
if
(
ctx
)
openCLSafeCall
(
clReleaseContext
(
ctx
));
context_tear_down
=
1
;
Context
*
cv_ctx
=
Context
::
getContext
();
if
(
cv_ctx
)
{
cl_context
ctx
=
(
cl_context
)
&
(
cv_ctx
->
impl
->
oclcontext
);
if
(
ctx
)
openCLSafeCall
(
clReleaseContext
(
ctx
));
}
}
return
TRUE
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录