aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-28 17:15:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-01-28 17:15:41 +0000
commit8b1d81f4eed25b1f883d68871a9e5d4c655e888b (patch)
tree3f2ce6672be5fc2196c5c81011a47e0d6a580af0 /include/asterisk/channel.h
parent940f913146cc96cda9132600151d40ee85680ee6 (diff)
Make some deadlock related fixes. These bugs were discovered and reported
internally at Digium by Steve Pitts. - Fix up chan_local to ensure that the channel lock is held before the local pvt lock. - Don't hold the channel lock when executing the timing function, as it can cause a deadlock when using chan_local. This actually changes the code back to be how it was before the change for issue #10765. But, I added some other locking that I think will prevent the problem reported there, as well. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100581 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r--include/asterisk/channel.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 23f1409f7..429308ee0 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -142,7 +142,10 @@ typedef unsigned long long ast_group_t;
struct ast_generator {
void *(*alloc)(struct ast_channel *chan, void *params);
void (*release)(struct ast_channel *chan, void *data);
- /*! This function gets called with the channel locked */
+ /*! This function gets called with the channel unlocked, but is called in
+ * the context of the channel thread so we know the channel is not going
+ * to disappear. This callback is responsible for locking the channel as
+ * necessary. */
int (*generate)(struct ast_channel *chan, void *data, int len, int samples);
};