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
abb69b8d
Commit
abb69b8d
authored
Jun 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Use pthread for surface locking.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
f9e2dac1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
window.c
dlls/wineandroid.drv/window.c
+8
-7
No files found.
dlls/wineandroid.drv/window.c
View file @
abb69b8d
...
...
@@ -579,7 +579,7 @@ struct android_window_surface
BYTE
alpha
;
COLORREF
color_key
;
void
*
bits
;
CRITICAL_SECTION
crit
;
pthread_mutex_t
mutex
;
BITMAPINFO
info
;
/* variable size, must be last */
};
...
...
@@ -652,7 +652,7 @@ static void android_surface_lock( struct window_surface *window_surface )
{
struct
android_window_surface
*
surface
=
get_android_surface
(
window_surface
);
EnterCriticalSection
(
&
surface
->
crit
);
pthread_mutex_lock
(
&
surface
->
mutex
);
}
/***********************************************************************
...
...
@@ -662,7 +662,7 @@ static void android_surface_unlock( struct window_surface *window_surface )
{
struct
android_window_surface
*
surface
=
get_android_surface
(
window_surface
);
LeaveCriticalSection
(
&
surface
->
crit
);
pthread_mutex_unlock
(
&
surface
->
mutex
);
}
/***********************************************************************
...
...
@@ -802,8 +802,6 @@ static void android_surface_destroy( struct window_surface *window_surface )
TRACE
(
"freeing %p bits %p
\n
"
,
surface
,
surface
->
bits
);
surface
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
surface
->
crit
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
->
region_data
);
if
(
surface
->
region
)
NtGdiDeleteObjectApp
(
surface
->
region
);
release_ioctl_window
(
surface
->
window
);
...
...
@@ -902,6 +900,7 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect,
{
struct
android_window_surface
*
surface
;
int
width
=
rect
->
right
-
rect
->
left
,
height
=
rect
->
bottom
-
rect
->
top
;
pthread_mutexattr_t
attr
;
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
FIELD_OFFSET
(
struct
android_window_surface
,
info
.
bmiColors
[
3
]
));
...
...
@@ -912,8 +911,10 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect,
surface
->
info
.
bmiHeader
.
biPlanes
=
1
;
surface
->
info
.
bmiHeader
.
biSizeImage
=
get_dib_image_size
(
&
surface
->
info
);
InitializeCriticalSection
(
&
surface
->
crit
);
surface
->
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": surface"
);
pthread_mutexattr_init
(
&
attr
);
pthread_mutexattr_settype
(
&
attr
,
PTHREAD_MUTEX_RECURSIVE
);
pthread_mutex_init
(
&
surface
->
mutex
,
&
attr
);
pthread_mutexattr_destroy
(
&
attr
);
surface
->
header
.
funcs
=
&
android_surface_funcs
;
surface
->
header
.
rect
=
*
rect
;
...
...
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