From: prascle Date: Fri, 9 Dec 2005 18:26:01 +0000 (+0000) Subject: PR: check return on sem_wait: interruptible by signal X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=162b0b292322cd773bfdbfa9f6036e1b2c234335;p=modules%2Fkernel.git PR: check return on sem_wait: interruptible by signal --- diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 4523a897d..c7d321ec6 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -169,7 +169,12 @@ int LocalTraceBufferPool::insert(int traceType, const char* msg) // wait until there is a free buffer in the pool - int ret = sem_wait(&_freeBufferSemaphore); + int ret = -1; + while (ret) + { + ret = sem_wait(&_freeBufferSemaphore); + if (ret) perror(" LocalTraceBufferPool::insert, sem_wait"); + } // get the next free buffer available (mutex protected) @@ -209,7 +214,12 @@ int LocalTraceBufferPool::retrieve(LocalTrace_TraceInfo& aTrace) // wait until there is a buffer in the pool, with a message to print - int ret = sem_wait(&_fullBufferSemaphore); + int ret = -1; + while (ret) + { + ret = sem_wait(&_fullBufferSemaphore); + if (ret) perror(" LocalTraceBufferPool::retrieve, sem_wait"); + } // get the next buffer to print