All pastes #30689 Raw Edit

Someone

public text v1 · immutable
#30689 ·published 2005-11-23 20:45 UTC
rendered paste body
Index: corelib/channel.c
===================================================================
--- corelib/channel.c	(revision 1088)
+++ corelib/channel.c	(working copy)
@@ -631,6 +631,11 @@
 {
 	struct opbx_frame f = { OPBX_FRAME_CONTROL, OPBX_CONTROL_HANGUP };
 	chan->_softhangup |= OPBX_SOFTHANGUP_DEV;
+	/* Yeah, let's not change a lock-critical value without locking */
+	if (!opbx_mutex_trylock(&chan->lock)) {
+		chan->_softhangup |= OPBX_SOFTHANGUP_DEV;
+		opbx_mutex_unlock(&chan->lock);
+	}
 	return opbx_queue_frame(chan, &f);
 }