switch_mutex_lock(node->update_mutex);
node->busy = 0;
- node->ring_consumer_count = 1;
+ node->ring_consumer_count++;
switch_mutex_unlock(node->update_mutex);
SWITCH_STANDARD_STREAM(stream);
if (node) {
switch_mutex_lock(node->update_mutex);
- node->ring_consumer_count = 0;
+ if (--node->ring_consumer_count < 0) {
+ node->ring_consumer_count = 0;
+ }
node->busy = 0;
switch_mutex_unlock(node->update_mutex);
switch_thread_rwlock_unlock(node->rwlock);
switch_event_destroy(&ovars);
if (node) {
switch_mutex_lock(node->update_mutex);
- if (node->ring_consumer_count-- < 0) {
+ if (--node->ring_consumer_count < 0) {
node->ring_consumer_count = 0;
}
node->busy = 0;