mirror of
https://github.com/asterisk/asterisk.git
synced 2026-05-07 13:53:50 +00:00
LIST instead of an RWLIST. The way this list works makes it such that a RWLIST provides no additional benefit. Also, a mutex is needed for use with the thread condition. Merged revisions 105563 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r105563 | russell | 2008-03-03 09:50:43 -0600 (Mon, 03 Mar 2008) | 24 lines Merge in some changes from team/russell/autoservice-nochans-1.4 These changes fix up some dubious code that I came across while auditing what happens in the autoservice thread when there are no channels currently in autoservice. 1) Change it so that autoservice thread doesn't keep looping around calling ast_waitfor_n() on 0 channels twice a second. Instead, use a thread condition so that the thread properly goes to sleep and does not wake up until a channel is put into autoservice. This actually fixes an interesting bug, as well. If the autoservice thread is already running (almost always is the case), then when the thread goes from having 0 channels to have 1 channel to autoservice, that channel would have to wait for up to 1/2 of a second to have the first frame read from it. 2) Fix up the code in ast_waitfor_nandfds() for when it gets called with no channels and no fds to poll() on, such as was the case with the previous code for the autoservice thread. In this case, the code would call alloca(0), and pass the result as the first argument to poll(). In this case, the 2nd argument to poll() specified that there were no fds, so this invalid pointer shouldn't actually get dereferenced, but, this code makes it explicit and ensures the pointers are NULL unless we have valid data to put there. (related to issue #12116) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
56 lines
2.0 KiB
C
56 lines
2.0 KiB
C
/*
|
|
* Prototypes for public functions only of internal interest,
|
|
* normally not used by modules.
|
|
* What goes here are typically *_init() routines.
|
|
*/
|
|
|
|
/*! \file
|
|
*
|
|
* \brief
|
|
* Prototypes for public functions only of internal interest,
|
|
*
|
|
*/
|
|
|
|
|
|
#ifndef _ASTERISK__PRIVATE_H
|
|
#define _ASTERISK__PRIVATE_H
|
|
|
|
int load_modules(unsigned int); /*!< Provided by loader.c */
|
|
int load_pbx(void); /*!< Provided by pbx.c */
|
|
int init_logger(void); /*!< Provided by logger.c */
|
|
void close_logger(void); /*!< Provided by logger.c */
|
|
int init_framer(void); /*!< Provided by frame.c */
|
|
int ast_term_init(void); /*!< Provided by term.c */
|
|
int astdb_init(void); /*!< Provided by db.c */
|
|
void ast_channels_init(void); /*!< Provided by channel.c */
|
|
void ast_builtins_init(void); /*!< Provided by cli.c */
|
|
int dnsmgr_init(void); /*!< Provided by dnsmgr.c */
|
|
void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */
|
|
int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */
|
|
void threadstorage_init(void); /*!< Provided by threadstorage.c */
|
|
void ast_event_init(void); /*!< Provided by event.c */
|
|
int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */
|
|
int astobj2_init(void); /*!< Provided by astobj2.c */
|
|
int ast_file_init(void); /*!< Provided by file.c */
|
|
int ast_features_init(void); /*!< Provided by features.c */
|
|
void ast_autoservice_init(void); /*!< Provided by autoservice.c */
|
|
|
|
/*!
|
|
* \brief Reload asterisk modules.
|
|
* \param name the name of the module to reload
|
|
*
|
|
* This function reloads the specified module, or if no modules are specified,
|
|
* it will reload all loaded modules.
|
|
*
|
|
* \note Modules are reloaded using their reload() functions, not unloading
|
|
* them and loading them again.
|
|
*
|
|
* \return 0 if the specified module was not found.
|
|
* \retval 1 if the module was found but cannot be reloaded.
|
|
* \retval -1 if a reload operation is already in progress.
|
|
* \retval 2 if the specfied module was found and reloaded.
|
|
*/
|
|
int ast_module_reload(const char *name);
|
|
|
|
#endif /* _ASTERISK__PRIVATE_H */
|