Changeset 0054378d6e90f6796759fca438a5ff209e19fbf8

Show
Ignore:
Timestamp:
01/03/07 22:38:58 (2 years ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1172785138 +0000
git-parent:

[7cdfb7ee8b66706492e2f781ded8deeef0566969]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1172785138 +0000
Message:

Fix a hang when quitting vlc on Mac OS X. This hang is due to the signal thread that isn't cancelled properly, because Mac OS X's sigwait is not a pthread cancellation point as it ought to be according to POSIX.1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/vlc.c

    rc13d67b r0054378  
    178178#if !defined(WIN32) && !defined(UNDER_CE) 
    179179    pthread_cancel (sigth); 
     180# ifdef __APPLE__ 
     181    /* In Mac OS X up to 10.4.8 sigwait (among others) is not a pthread 
     182     * cancellation point, so we throw a dummy quit signal to end 
     183     * sigwait() in the sigth thread */ 
     184    pthread_kill (sigth, SIGQUIT); 
     185# endif 
    180186    pthread_join (sigth, NULL); 
    181187#endif 
     
    201207        int i_signal, state; 
    202208        (void)sigwait (set, &i_signal); 
     209 
     210#ifdef __APPLE__ 
     211        /* In Mac OS X up to 10.4.8 sigwait (among others) is not a pthread 
     212         * cancellation point */ 
     213        pthread_testcancel(); 
     214#endif 
    203215 
    204216        /* Once a signal has been trapped, the termination sequence will be