Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
353ece46
Commit
353ece46
authored
Sep 24, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert hotkeys to using cond_wait/cond_signal
This removes useless wakeups and improves hotkeys reactivity
parent
a06213d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
modules/control/hotkeys.c
modules/control/hotkeys.c
+8
-2
src/interface/interface.c
src/interface/interface.c
+3
-0
No files found.
modules/control/hotkeys.c
View file @
353ece46
...
...
@@ -170,7 +170,7 @@ static void Run( intf_thread_t *p_intf )
int
i_times
=
0
;
/* Sleep a bit */
msleep
(
INTF_IDLE_SLEEP
);
//
msleep( INTF_IDLE_SLEEP );
/* Update the input */
if
(
p_intf
->
p_sys
->
p_input
==
NULL
)
...
...
@@ -228,8 +228,11 @@ static void Run( intf_thread_t *p_intf )
if
(
!
i_action
)
{
vlc_mutex_lock
(
&
p_intf
->
object_lock
);
vlc_cond_wait
(
&
p_intf
->
object_wait
,
&
p_intf
->
object_lock
);
vlc_mutex_unlock
(
&
p_intf
->
object_lock
);
/* No key pressed, sleep a bit more */
msleep
(
INTF_IDLE_SLEEP
);
//
msleep( INTF_IDLE_SLEEP );
continue
;
}
...
...
@@ -746,6 +749,9 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
p_intf
->
p_sys
->
p_keys
[
p_intf
->
p_sys
->
i_size
]
=
newval
.
i_int
;
p_intf
->
p_sys
->
i_size
++
;
}
vlc_mutex_lock
(
&
p_intf
->
object_lock
);
vlc_cond_signal
(
&
p_intf
->
object_wait
);
vlc_mutex_unlock
(
&
p_intf
->
object_lock
);
vlc_mutex_unlock
(
&
p_intf
->
p_sys
->
change_lock
);
return
VLC_SUCCESS
;
...
...
src/interface/interface.c
View file @
353ece46
...
...
@@ -261,7 +261,10 @@ void intf_StopThread( intf_thread_t *p_intf )
{
p_intf
->
b_die
=
VLC_TRUE
;
if
(
p_intf
->
pf_run
)
{
vlc_cond_signal
(
&
p_intf
->
object_wait
);
vlc_thread_join
(
p_intf
);
}
}
}
...
...
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