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
012d8b74
Commit
012d8b74
authored
Sep 20, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Use pthread_cancellation in the manage thread.
parent
697457bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
18 deletions
+33
-18
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+33
-18
No files found.
modules/gui/macosx/intf.m
View file @
012d8b74
...
...
@@ -1358,13 +1358,39 @@ static void * ManageThread( void *user_data )
return
NULL
;
}
struct
manage_cleanup_stack
{
intf_thread_t
*
p_intf
;
input_thread_t
**
p_input
;
playlist_t
*
p_playlist
;
id
self
;
};
static
void
*
manage_cleanup
(
void
*
args
)
{
struct
manage_cleanup_stack
*
manage_cleanup_stack
=
args
;
intf_thread_t
*
p_intf
=
manage_cleanup_stack
->
p_intf
;
input_thread_t
*
p_input
=
*
manage_cleanup_stack
->
p_input
;
id
self
=
manage_cleanup_stack
->
self
;
playlist_t
*
p_playlist
=
manage_cleanup_stack
->
p_playlist
;
var_AddCallback
(
p_playlist
,
"playlist-current"
,
PlaylistChanged
,
self
);
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
self
);
var_AddCallback
(
p_playlist
,
"item-change"
,
PlaylistChanged
,
self
);
var_AddCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
self
);
var_AddCallback
(
p_playlist
,
"item-deleted"
,
PlaylistChanged
,
self
);
pl_Release
(
p_intf
);
if
(
p_input
)
vlc_object_release
(
p_input
);
return
NULL
;
}
-
(
void
)
manage
{
playlist_t
*
p_playlist
;
input_thread_t
*
p_input
=
NULL
;
/* new thread requires a new pool */
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
vlc_thread_set_priority
(
p_intf
,
VLC_THREAD_PRIORITY_LOW
);
...
...
@@ -1376,12 +1402,12 @@ static void * ManageThread( void *user_data )
var_AddCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
self
);
var_AddCallback
(
p_playlist
,
"item-deleted"
,
PlaylistChanged
,
self
);
pl_Release
(
p_intf
);
vlc_object_lock
(
p_intf
);
struct
manage_cleanup_stack
stack
=
{
p_intf
,
&
p_input
,
p_playlist
,
self
};
pthread_cleanup_push
(
manage_cleanup
,
&
stack
);
while
(
vlc_object_alive
(
p_intf
)
)
while
(
true
)
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
!
p_input
)
...
...
@@ -1414,22 +1440,11 @@ static void * ManageThread( void *user_data )
vlc_mutex_unlock
(
&
p_intf
->
change_lock
);
vlc_object_unlock
(
p_intf
);
msleep
(
INTF_IDLE_SLEEP
);
vlc_object_lock
(
p_intf
)
;
[
pool
release
]
;
}
vlc_object_unlock
(
p_intf
);
[
o_pool
release
];
if
(
p_input
)
vlc_object_release
(
p_input
);
var_DelCallback
(
p_playlist
,
"playlist-current"
,
PlaylistChanged
,
self
);
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
self
);
var_DelCallback
(
p_playlist
,
"item-change"
,
PlaylistChanged
,
self
);
var_DelCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
self
);
var_DelCallback
(
p_playlist
,
"item-deleted"
,
PlaylistChanged
,
self
);
pthread_
testcancel
();
/* If we were cancelled stop here */
pthread_
cleanup_pop
(
1
);
msg_Dbg
(
p_intf
,
"Killing the Mac OS X module"
);
...
...
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