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
3ab98869
Commit
3ab98869
authored
May 17, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use pthread for cursor cache locking.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eae3578d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
mouse.c
dlls/winemac.drv/mouse.c
+7
-15
No files found.
dlls/winemac.drv/mouse.c
View file @
3ab98869
...
...
@@ -32,15 +32,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
cursor
);
static
CRITICAL_SECTION
cursor_cache_section
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
{
0
,
0
,
&
cursor_cache_section
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": cursor_cache_section"
)
}
};
static
CRITICAL_SECTION
cursor_cache_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
pthread_mutex_t
cursor_cache_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
CFMutableDictionaryRef
cursor_cache
;
...
...
@@ -647,10 +639,10 @@ void macdrv_DestroyCursorIcon(HCURSOR cursor)
{
TRACE
(
"cursor %p
\n
"
,
cursor
);
EnterCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_lock
(
&
cursor_cache_mutex
);
if
(
cursor_cache
)
CFDictionaryRemoveValue
(
cursor_cache
,
cursor
);
LeaveCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_unlock
(
&
cursor_cache_mutex
);
}
...
...
@@ -731,7 +723,7 @@ void macdrv_SetCursor(HCURSOR cursor)
{
ICONINFOEXW
info
;
EnterCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_lock
(
&
cursor_cache_mutex
);
if
(
cursor_cache
)
{
CFTypeRef
cached_cursor
=
CFDictionaryGetValue
(
cursor_cache
,
cursor
);
...
...
@@ -743,7 +735,7 @@ void macdrv_SetCursor(HCURSOR cursor)
cursor_frames
=
CFRetain
(
cached_cursor
);
}
}
LeaveCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_unlock
(
&
cursor_cache_mutex
);
if
(
cursor_name
||
cursor_frames
)
goto
done
;
...
...
@@ -790,13 +782,13 @@ void macdrv_SetCursor(HCURSOR cursor)
if
(
cursor_name
||
cursor_frames
)
{
EnterCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_lock
(
&
cursor_cache_mutex
);
if
(
!
cursor_cache
)
cursor_cache
=
CFDictionaryCreateMutable
(
NULL
,
0
,
NULL
,
&
kCFTypeDictionaryValueCallBacks
);
CFDictionarySetValue
(
cursor_cache
,
cursor
,
cursor_name
?
(
CFTypeRef
)
cursor_name
:
(
CFTypeRef
)
cursor_frames
);
LeaveCriticalSection
(
&
cursor_cache_section
);
pthread_mutex_unlock
(
&
cursor_cache_mutex
);
}
else
cursor_name
=
CFRetain
(
CFSTR
(
"arrowCursor"
));
...
...
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