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
eae3578d
Commit
eae3578d
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 keyboard list locking.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e24c2fa3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
keyboard.c
dlls/winemac.drv/keyboard.c
+9
-16
No files found.
dlls/winemac.drv/keyboard.c
View file @
eae3578d
...
...
@@ -437,14 +437,7 @@ struct layout
BOOL
enabled
;
/* is the input source enabled - ie displayed in the input source selector UI */
};
static
CRITICAL_SECTION
layout_list_section
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
{
0
,
0
,
&
layout_list_section
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": layout_list_section"
)
}
};
static
CRITICAL_SECTION
layout_list_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
pthread_mutex_t
layout_list_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
int
macdrv_layout_list_needs_update
=
TRUE
;
...
...
@@ -486,7 +479,7 @@ static HKL get_hkl(CFStringRef lang, CFStringRef type)
/******************************************************************
* get_layout_from_source
*
* Must be called while holding the layout_list_
section
.
* Must be called while holding the layout_list_
mutex
.
* Note, returned layout may not currently be enabled.
*/
static
struct
layout
*
get_layout_from_source
(
TISInputSourceRef
input
)
...
...
@@ -507,7 +500,7 @@ static struct layout *get_layout_from_source(TISInputSourceRef input)
/***********************************************************************
* update_layout_list
*
* Must be called while holding the layout_list_
section
* Must be called while holding the layout_list_
mutex
*
* If an input source has been disabled (ie. removed from the UI) its
* entry remains in the layout list but is marked as such and is not
...
...
@@ -563,13 +556,13 @@ HKL macdrv_get_hkl_from_source(TISInputSourceRef input)
struct
layout
*
layout
;
HKL
ret
=
0
;
EnterCriticalSection
(
&
layout_list_section
);
pthread_mutex_lock
(
&
layout_list_mutex
);
update_layout_list
();
layout
=
get_layout_from_source
(
input
);
if
(
layout
)
ret
=
layout
->
hkl
;
LeaveCriticalSection
(
&
layout_list_section
);
pthread_mutex_unlock
(
&
layout_list_mutex
);
return
ret
;
}
...
...
@@ -1172,7 +1165,7 @@ BOOL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
if
(
hkl
==
thread_data
->
active_keyboard_layout
)
return
TRUE
;
EnterCriticalSection
(
&
layout_list_section
);
pthread_mutex_lock
(
&
layout_list_mutex
);
update_layout_list
();
LIST_FOR_EACH_ENTRY
(
layout
,
&
layout_list
,
struct
layout
,
entry
)
...
...
@@ -1195,7 +1188,7 @@ BOOL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
break
;
}
}
LeaveCriticalSection
(
&
layout_list_section
);
pthread_mutex_unlock
(
&
layout_list_mutex
);
return
ret
;
}
...
...
@@ -1306,7 +1299,7 @@ UINT macdrv_GetKeyboardLayoutList(INT size, HKL *list)
TRACE
(
"%d, %p
\n
"
,
size
,
list
);
EnterCriticalSection
(
&
layout_list_section
);
pthread_mutex_lock
(
&
layout_list_mutex
);
update_layout_list
();
...
...
@@ -1321,7 +1314,7 @@ UINT macdrv_GetKeyboardLayoutList(INT size, HKL *list)
}
count
++
;
}
LeaveCriticalSection
(
&
layout_list_section
);
pthread_mutex_unlock
(
&
layout_list_mutex
);
TRACE
(
"returning %d
\n
"
,
count
);
return
count
;
...
...
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