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
ed65a598
Commit
ed65a598
authored
Apr 01, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix playlist deadlock between Timer and Playlist stuff
There are still other deadlocks in wx though
parent
2d16a408
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
10 deletions
+30
-10
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+7
-7
modules/gui/wxwindows/timer.cpp
modules/gui/wxwindows/timer.cpp
+3
-3
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+20
-0
No files found.
modules/gui/wxwindows/playlist.cpp
View file @
ed65a598
/*****************************************************************************
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-200
4
VideoLAN
* Copyright (C) 2000-200
5
VideoLAN
* $Id$
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
...
...
@@ -838,7 +838,7 @@ void Playlist::Rebuild( vlc_bool_t b_root )
var_DelCallback
(
p_playlist
,
"item-deleted"
,
ItemDeleted
,
this
);
/* ...and rebuild it */
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
}
p_view
=
playlist_ViewFind
(
p_playlist
,
i_current_view
);
/* FIXME */
...
...
@@ -882,7 +882,7 @@ void Playlist::Rebuild( vlc_bool_t b_root )
var_AddCallback
(
p_playlist
,
"item-append"
,
ItemAppended
,
this
);
var_AddCallback
(
p_playlist
,
"item-deleted"
,
ItemDeleted
,
this
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
}
vlc_object_release
(
p_playlist
);
}
...
...
@@ -1066,7 +1066,7 @@ void Playlist::OnSort( wxCommandEvent& event )
{
return
;
}
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
switch
(
event
.
GetId
()
)
{
case
SortTitle_Event
:
...
...
@@ -1077,7 +1077,7 @@ void Playlist::OnSort( wxCommandEvent& event )
playlist_RecursiveNodeSort
(
p_playlist
,
p_wxitem
->
p_item
,
SORT_TITLE_NODES_FIRST
,
ORDER_REVERSE
);
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
vlc_object_release
(
p_playlist
);
Rebuild
(
VLC_TRUE
);
...
...
@@ -1557,10 +1557,10 @@ void Playlist::OnPopupSort( wxMenuEvent& event )
if
(
p_playlist
)
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
playlist_RecursiveNodeSort
(
p_playlist
,
p_wxitem
->
p_item
,
SORT_TITLE_NODES_FIRST
,
ORDER_NORMAL
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
treectrl
->
DeleteChildren
(
i_popup_item
);
UpdateNodeChildren
(
p_playlist
,
p_wxitem
->
p_item
,
i_popup_item
);
...
...
modules/gui/wxwindows/timer.cpp
View file @
ed65a598
/*****************************************************************************
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-200
3
VideoLAN
* Copyright (C) 2000-200
5
VideoLAN
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
...
...
@@ -120,11 +120,11 @@ void Timer::Notify()
FIND_ANYWHERE
);
if
(
p_playlist
!=
NULL
)
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
p_intf
->
p_sys
->
p_input
=
p_playlist
->
p_input
;
if
(
p_intf
->
p_sys
->
p_input
)
vlc_object_yield
(
p_intf
->
p_sys
->
p_input
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
vlc_object_release
(
p_playlist
);
}
...
...
modules/gui/wxwindows/wxwindows.h
View file @
ed65a598
...
...
@@ -124,6 +124,7 @@ struct intf_sys_t
/* Playlist management */
int
i_playing
;
/* playlist selected item */
unsigned
i_playlist_usage
;
/* Send an event to show a dialog */
void
(
*
pf_show_dialog
)
(
intf_thread_t
*
p_intf
,
int
i_dialog
,
int
i_arg
,
...
...
@@ -1083,5 +1084,24 @@ private:
};
}
// end of wxvlc namespace
/*
* wxWindows keeps dead locking because the timer tries to lock the playlist
* when it's already locked somewhere else in the very wxWindows interface
* module. Unless someone implements a "vlc_mutex_trylock", we need that.
*/
inline
void
LockPlaylist
(
intf_sys_t
*
p_sys
,
playlist_t
*
p_pl
)
{
if
(
p_sys
->
i_playlist_usage
++
==
0
)
vlc_mutex_lock
(
&
p_pl
->
object_lock
);
}
inline
void
UnlockPlaylist
(
intf_sys_t
*
p_sys
,
playlist_t
*
p_pl
)
{
if
(
--
p_sys
->
i_playlist_usage
==
0
)
vlc_mutex_unlock
(
&
p_pl
->
object_lock
);
}
using
namespace
wxvlc
;
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