X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-stream.c;h=b5ab6c6bee2dc38ef615ff84f87129354abf86a2;hp=24f1b8a42d14c580c013f3f38bac9b9576f3c89a;hb=07b86b528dc279d59cdf16e6cb946c144fe773f2;hpb=2bba9e532ca1910822005ff7f67400a2e871467c diff --git a/src/common/consumer-stream.c b/src/common/consumer-stream.c index 24f1b8a42..b5ab6c6be 100644 --- a/src/common/consumer-stream.c +++ b/src/common/consumer-stream.c @@ -177,9 +177,15 @@ void consumer_stream_delete(struct lttng_consumer_stream *stream, rcu_read_unlock(); - /* Decrement the stream count of the global consumer data. */ - assert(consumer_data.stream_count > 0); - consumer_data.stream_count--; + /* + * For a *non* monitored stream, we MUST NOT decrement or else the data + * thread will use the wrong value or stream for its local stream set. + */ + if (stream->chan->monitor) { + /* Decrement the stream count of the global consumer data. */ + assert(consumer_data.stream_count > 0); + consumer_data.stream_count--; + } } /*