diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index 6e09e58e2b495e9fc3f09af1617717021dfe507a..8ea0e54d822e1b0c630a02336bf62450815d33f6 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -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; } diff --git a/readme.txt b/readme.txt index cd5a01d4bed7837f7f29b9856d32858aba6d152b..e6fbd729ead207359e6e304a12d7ea5f9ff29388 100644 --- a/readme.txt +++ b/readme.txt @@ -150,6 +150,24 @@ executables are "IVAS_cod.exe", "IVAS_dec.exe", "IVAS_rend.exe", and "ISAR_post_rend.exe". All reside in the c-code main directory. + INTEGRATION AS LIBRARIES + ======================== + +While this package contains the necessary applications to execute the IVAS encoder, +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, 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 +optimized for fine-granular locking of just critical sections. Some sensitive +sections have thus been marked with a comment in the form /* LOCK XYZ BEGIN */ and +/* LOCK XYZ END */ to provide guidance where code could be modified to prevent +some potential race conditions. + + RUNNING THE SOFTWARE ====================