Synchronization issue of libv4l2 open source library

Hi.

There is a comment in the file NvV4l2Element.cpp:

/* Synchronization issue of libv4l2 open source library fixing here, adding lock for that */
 pthread_mutex_lock(&initializer_mutex);
    fd = v4l2_open(dev_node, flags | O_RDWR);
    if (fd == -1)
    {
        COMP_SYS_ERROR_MSG("Could not open device '" << dev_node << "'");
        is_in_error = 1;
        pthread_mutex_unlock(&initializer_mutex);
        return;
    }
    pthread_mutex_unlock(&initializer_mutex);

Is the comment about synchronization issue relevant to the release 32.2.1? mutex still needed?

Do I need to use a mutex when closing a device handle?

Hi,
We have seen issues in concurrently initializing NvVideoEncoder, and fix it by adding the lock. It is not required in closing device.

You may remove it for a try, but we suggest keep it.