mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-26 12:36:15 -05:00
[threads] Update mutex/cond functions to use new CHECK_ERR macros
Added various macros to check return values and log any errors and abort if the call fails. Updated logging to handle early errors before logging initialized.
This commit is contained in:
@@ -428,19 +428,19 @@ ffmpeg_lockmgr(void **pmutex, enum AVLockOp op)
|
||||
*pmutex = malloc(sizeof(pthread_mutex_t));
|
||||
if (!*pmutex)
|
||||
return 1;
|
||||
fork_mutex_init(*pmutex);
|
||||
CHECK_ERR(L_MAIN, mutex_init(*pmutex));
|
||||
return 0;
|
||||
|
||||
case AV_LOCK_OBTAIN:
|
||||
fork_mutex_lock(*pmutex);
|
||||
CHECK_ERR(L_MAIN, pthread_mutex_lock(*pmutex));
|
||||
return 0;
|
||||
|
||||
case AV_LOCK_RELEASE:
|
||||
fork_mutex_unlock(*pmutex);
|
||||
CHECK_ERR(L_MAIN, pthread_mutex_unlock(*pmutex));
|
||||
return 0;
|
||||
|
||||
case AV_LOCK_DESTROY:
|
||||
fork_mutex_destroy(*pmutex);
|
||||
CHECK_ERR(L_MAIN, pthread_mutex_destroy(*pmutex));
|
||||
free(*pmutex);
|
||||
*pmutex = NULL;
|
||||
|
||||
@@ -450,7 +450,6 @@ ffmpeg_lockmgr(void **pmutex, enum AVLockOp op)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user