Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
b394e8e7
Commit
b394e8e7
authored
May 31, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal_macosx: Add a KillerThread, that will kill the App when the intf is killed.
parent
f3b97438
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
modules/gui/minimal_macosx/intf.m
modules/gui/minimal_macosx/intf.m
+30
-0
No files found.
modules/gui/minimal_macosx/intf.m
View file @
b394e8e7
...
...
@@ -89,6 +89,28 @@ extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
/*****************************************************************************
* KillerThread: Thread that kill the application
*****************************************************************************/
static void * KillerThread( void *user_data )
{
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
intf_thread_t *p_intf = user_data;
vlc_object_lock ( p_intf );
while( vlc_object_alive( p_intf ) )
vlc_object_wait( p_intf );
vlc_object_unlock( p_intf );
msg_Dbg( p_intf, "Killing the Mac OS X module" );
/* We are dead, terminate */
[NSApp terminate: nil];
[o_pool release];
return NULL;
}
/*****************************************************************************
* Run: main loop
*****************************************************************************/
...
...
@@ -108,6 +130,11 @@ static void Run( intf_thread_t *p_intf )
sigemptyset(
&
set );
sigaddset(
&
set, SIGTERM );
pthread_sigmask( SIG_UNBLOCK,
&
set, NULL );
/* Setup a thread that will monitor the module killing */
pthread_t killer_thread;
pthread_create(
&
killer_thread, NULL, KillerThread, p_intf );
CPSProcessSerNum PSN;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
...
...
@@ -116,6 +143,9 @@ static void Run( intf_thread_t *p_intf )
if (!CPSSetFrontProcess(
&
PSN))
[NSApplication sharedApplication];
[NSApp run];
pthread_join( killer_thread, NULL );
[pool release];
}
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