Commit 958999da authored by Ripinder Singh's avatar Ripinder Singh
Browse files

[Issue 1136] Introduce comments to indicate critical section in JBM



* Comment added to critical section in alloc/free data in jbm_jb4sb.c

Signed-off-by: default avatarSingh, Ripinder <ripinder.singh@dolby.com>
parent 1986afdb
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -381,9 +381,11 @@ JB4_DATAUNIT_HANDLE JB4_AllocDataUnit(
        JB4_dropFromBuffer( h );
    }

    /* LOCK JBM MEMORY SLOT BEGIN */
    --h->nFreeMemorySlots;
    dataUnit = h->freeMemorySlots[h->nFreeMemorySlots];
    h->freeMemorySlots[h->nFreeMemorySlots] = NULL;
    /* LOCK JBM MEMORY SLOT END */
    assert( dataUnit != NULL );

    return dataUnit;
@@ -397,8 +399,10 @@ void JB4_FreeDataUnit(
{
    assert( dataUnit != NULL );
    assert( h->nFreeMemorySlots < MAX_JBM_SLOTS );
    /* LOCK JBM MEMORY SLOT BEGIN */
    h->freeMemorySlots[h->nFreeMemorySlots] = dataUnit;
    h->nFreeMemorySlots++;
    /* LOCK JBM MEMORY SLOT END */

    return;
}
+2 −2
Original line number Diff line number Diff line
@@ -157,8 +157,8 @@ While this package contains the necessary applications to execute the IVAS encod
decoder, renderer and ISAR post renderer, it is envisioned that the libraries used
would be integrated into custom applications.

It should be noted that this library is not thread-safe by default. Thus, wen using
the IVAS libraries in a mult-threaded environment, proper synchronization of API
It should be noted that this library is not thread-safe by default. Thus, when using
the IVAS libraries in a multi-threaded environment, proper synchronization of API
calls is required to prevent race conditions by concurrent access to IVAS internal
state memory, FIFO queues buffers or any other data structures. Potential mechanisms
include e.g. mutexes, spinlocks and semaphores. The API calls are at the present not