Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
72e49dc7
Commit
72e49dc7
authored
Apr 05, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Apr 05, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #777 from taka-no-me:ocl_win_hang
parents
a2d27429
3400d837
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
initialization.cpp
modules/ocl/src/initialization.cpp
+11
-4
No files found.
modules/ocl/src/initialization.cpp
View file @
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment