+ /* We detect if a signal came between
+ * the offset read and signal disabling:
+ * if it is the case, then we restart
+ * the loop after reenabling signals. It
+ * means that it's a signal that has
+ * won the buffer switch.*/
+ if(offset_old != atomic_read(<t_buf->offset)) {
+ ret = pthread_sigmask(SIG_SETMASK, &oldset, NULL);
+ if(ret) perror("LTT Error in pthread_sigmask\n");
+ continue;
+ }
+ /* If the offset is still the same, then
+ * we can safely proceed to do the
+ * buffer switch without being
+ * interrupted by a signal. */