diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-08 21:44:58 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-08 21:44:58 +0000 |
commit | a4803d15a244be2cbd7f852c4fcefe71f5ffaabc (patch) | |
tree | d42170fbe8a83884d32f1ed09f238da151554071 /include/asterisk | |
parent | 21b3ffbe757d2c93610ab1c069116399ef4fdaee (diff) |
Add support for using epoll instead of poll. This should increase scalability and is done in such a way that we should be able to add support for other poll() replacements.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78683 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/autoconfig.h.in | 3 | ||||
-rw-r--r-- | include/asterisk/channel.h | 16 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 1031ee8ab..0facfe2be 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -114,6 +114,9 @@ /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT +/* Define to 1 if your system has working epoll support. */ +#undef HAVE_EPOLL + /* Define this to indicate the ${EXP10_DESCRIP} library */ #undef HAVE_EXP10 diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 39f2c636d..b58880853 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -316,6 +316,8 @@ struct ast_channel_tech { int (* func_channel_write)(struct ast_channel *chan, const char *function, char *data, const char *value); }; +struct ast_epoll_data; + /*! * The high bit of the frame count is used as a debug marker, so * increments of the counters must be done with care. @@ -490,6 +492,11 @@ struct ast_channel { /*! \brief Data stores on the channel */ AST_LIST_HEAD_NOLOCK(datastores, ast_datastore) datastores; + +#ifdef HAVE_EPOLL + int epfd; + struct ast_epoll_data *epfd_data[AST_MAX_FDS]; +#endif }; /*! \brief ast_channel_tech Properties */ @@ -1184,6 +1191,15 @@ void ast_deactivate_generator(struct ast_channel *chan); void ast_set_callerid(struct ast_channel *chan, const char *cidnum, const char *cidname, const char *ani); +/*! Set the file descriptor on the channel */ +void ast_channel_set_fd(struct ast_channel *chan, int which, int fd); + +/*! Add a channel to an optimized waitfor */ +void ast_poll_channel_add(struct ast_channel *chan0, struct ast_channel *chan1); + +/*! Delete a channel from an optimized waitfor */ +void ast_poll_channel_del(struct ast_channel *chan0, struct ast_channel *chan1); + /*! Start a tone going */ int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol); /*! Stop a tone from playing */ |