Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
706bc26a
Commit
706bc26a
authored
Feb 23, 2007
by
Jan Zerebecki
Committed by
Alexandre Julliard
Feb 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make CreateFakeGLContext thread safe.
parent
85d9b024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
directx.c
dlls/wined3d/directx.c
+20
-3
No files found.
dlls/wined3d/directx.c
View file @
706bc26a
...
...
@@ -78,11 +78,24 @@ static BOOL wined3d_fake_gl_context_foreign;
static
BOOL
wined3d_fake_gl_context_available
=
FALSE
;
static
Display
*
wined3d_fake_gl_context_display
=
NULL
;
static
CRITICAL_SECTION
wined3d_fake_gl_context_cs
;
static
CRITICAL_SECTION_DEBUG
wined3d_fake_gl_context_cs_debug
=
{
0
,
0
,
&
wined3d_fake_gl_context_cs
,
{
&
wined3d_fake_gl_context_cs_debug
.
ProcessLocksList
,
&
wined3d_fake_gl_context_cs_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": wined3d_fake_gl_context_cs"
)
}
};
static
CRITICAL_SECTION
wined3d_fake_gl_context_cs
=
{
&
wined3d_fake_gl_context_cs_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
void
WineD3D_ReleaseFakeGLContext
(
void
)
{
GLXContext
glCtx
;
EnterCriticalSection
(
&
wined3d_fake_gl_context_cs
);
if
(
!
wined3d_fake_gl_context_available
)
{
TRACE_
(
d3d_caps
)(
"context not available
\n
"
);
LeaveCriticalSection
(
&
wined3d_fake_gl_context_cs
);
return
;
}
...
...
@@ -95,17 +108,21 @@ static void WineD3D_ReleaseFakeGLContext(void) {
glXMakeCurrent
(
wined3d_fake_gl_context_display
,
None
,
NULL
);
glXDestroyContext
(
wined3d_fake_gl_context_display
,
glCtx
);
}
LEAVE_GL
();
wined3d_fake_gl_context_available
=
FALSE
;
}
assert
(
wined3d_fake_gl_context_ref
>=
0
);
LeaveCriticalSection
(
&
wined3d_fake_gl_context_cs
);
LEAVE_GL
();
}
static
BOOL
WineD3D_CreateFakeGLContext
(
void
)
{
XVisualInfo
*
visInfo
;
GLXContext
glCtx
;
ENTER_GL
();
EnterCriticalSection
(
&
wined3d_fake_gl_context_cs
);
TRACE_
(
d3d_caps
)(
"getting context...
\n
"
);
if
(
wined3d_fake_gl_context_ref
>
0
)
goto
ret
;
assert
(
0
==
wined3d_fake_gl_context_ref
);
...
...
@@ -119,8 +136,6 @@ static BOOL WineD3D_CreateFakeGLContext(void) {
ReleaseDC
(
0
,
device_context
);
}
ENTER_GL
();
visInfo
=
NULL
;
glCtx
=
glXGetCurrentContext
();
...
...
@@ -170,10 +185,12 @@ static BOOL WineD3D_CreateFakeGLContext(void) {
TRACE_
(
d3d_caps
)(
"incrementing ref from %i
\n
"
,
wined3d_fake_gl_context_ref
);
wined3d_fake_gl_context_ref
++
;
wined3d_fake_gl_context_available
=
TRUE
;
LeaveCriticalSection
(
&
wined3d_fake_gl_context_cs
);
return
TRUE
;
fail:
if
(
visInfo
)
XFree
(
visInfo
);
if
(
glCtx
)
glXDestroyContext
(
wined3d_fake_gl_context_display
,
glCtx
);
LeaveCriticalSection
(
&
wined3d_fake_gl_context_cs
);
LEAVE_GL
();
return
FALSE
;
}
...
...
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