static void PictureDestroy( picture_t *p_picture ) { assert( p_picture && vlc_atomic_get( &p_picture->gc.refcount ) == 0 ); vlc_free( p_picture->gc.p_sys ); free( p_picture->p_sys ); free( p_picture ); }
void vlc_testcancel (void) { if (!thread) /* not created by VLC, can't be cancelled */ return; if (!thread->killable) return; if (!vlc_atomic_get(&thread->killed)) return; pthread_exit(NULL); }
uintptr_t vlc_atomic_swap (vlc_atomic_t *atom, uintptr_t v) { /* grmbl, gcc does not provide an intrinsic for this! */ uintptr_t u; do u = vlc_atomic_get (atom); while (vlc_atomic_compare_swap (atom, u, v) != u); return u; }
void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item, const char *format, va_list ap ) { MessagesDialog *dialog = (MessagesDialog *)self; char *str; int verbosity = vlc_atomic_get( &dialog->verbosity ); if( verbosity < 0 || verbosity < (type - VLC_MSG_ERR) || unlikely(vasprintf( &str, format, ap ) == -1) ) return; int canc = vlc_savecancel(); QApplication::postEvent( dialog, new MsgEvent( type, item, str ) ); vlc_restorecancel( canc ); free( str ); }
bool picture_IsReferenced( picture_t *p_picture ) { return vlc_atomic_get( &p_picture->gc.refcount ) > 1; }