Skip to content

Commit

Permalink
added missing init calls for mutexattr to hopefully fix random crash …
Browse files Browse the repository at this point in the history
…at startup
  • Loading branch information
elFarto committed Aug 27, 2022
1 parent 8e66a2f commit e94663c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vabackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include <time.h>

pthread_mutex_t concurrency_mutex;
pthread_mutex_t concurrency_mutex = PTHREAD_MUTEX_INITIALIZER;
static uint32_t instances;
static uint32_t max_instances = 0;

Expand Down Expand Up @@ -806,6 +806,7 @@ static VAStatus nvCreateContext(
nvCtx->codec = selectedCodec;

pthread_mutexattr_t attrib;
pthread_mutexattr_init(&attrib);
pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&nvCtx->surfaceCreationMutex, &attrib);

Expand Down Expand Up @@ -1844,6 +1845,7 @@ VAStatus __vaDriverInit_1_0(VADriverContextP ctx)
}

pthread_mutexattr_t attrib;
pthread_mutexattr_init(&attrib);
pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&drv->objectCreationMutex, &attrib);
pthread_mutex_init(&drv->imagesMutex, &attrib);
Expand Down

0 comments on commit e94663c

Please sign in to comment.