- Doxygen formatting

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Olle Johansson 20 years ago
parent 5a2b0d6c2b
commit 137422ba91

@ -50,29 +50,23 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
(((b).tv_sec == (a).tv_sec) && ((b).tv_usec > (a).tv_usec))) (((b).tv_sec == (a).tv_sec) && ((b).tv_usec > (a).tv_usec)))
struct sched { struct sched {
struct sched *next; /* Next event in the list */ struct sched *next; /*!< Next event in the list */
int id; /* ID number of event */ int id; /*!< ID number of event */
struct timeval when; /* Absolute time event should take place */ struct timeval when; /*!< Absolute time event should take place */
int resched; /* When to reschedule */ int resched; /*!< When to reschedule */
int variable; /* Use return value from callback to reschedule */ int variable; /*!< Use return value from callback to reschedule */
void *data; /* Data */ void *data; /*!< Data */
ast_sched_cb callback; /* Callback */ ast_sched_cb callback; /*!< Callback */
}; };
struct sched_context { struct sched_context {
ast_mutex_t lock; ast_mutex_t lock;
/* Number of events processed */ int eventcnt; /*!< Number of events processed */
int eventcnt; int schedcnt; /*!< Number of outstanding schedule events */
struct sched *schedq; /*!< Schedule entry and main queue */
/* Number of outstanding schedule events */
int schedcnt;
/* Schedule entry and main queue */
struct sched *schedq;
#ifdef SCHED_MAX_CACHE #ifdef SCHED_MAX_CACHE
/* Cache of unused schedule structures and how many */ struct sched *schedc; /*!< Cache of unused schedule structures and how many */
struct sched *schedc;
int schedccnt; int schedccnt;
#endif #endif
}; };
@ -156,12 +150,12 @@ static void sched_release(struct sched_context *con, struct sched *tmp)
free(tmp); free(tmp);
} }
int ast_sched_wait(struct sched_context *con) /*! \brief
{
/*
* Return the number of milliseconds * Return the number of milliseconds
* until the next scheduled event * until the next scheduled event
*/ */
int ast_sched_wait(struct sched_context *con)
{
int ms; int ms;
DEBUG(ast_log(LOG_DEBUG, "ast_sched_wait()\n")); DEBUG(ast_log(LOG_DEBUG, "ast_sched_wait()\n"));
ast_mutex_lock(&con->lock); ast_mutex_lock(&con->lock);
@ -178,13 +172,13 @@ int ast_sched_wait(struct sched_context *con)
} }
static void schedule(struct sched_context *con, struct sched *s) /*! \brief
{
/*
* Take a sched structure and put it in the * Take a sched structure and put it in the
* queue, such that the soonest event is * queue, such that the soonest event is
* first in the list. * first in the list.
*/ */
static void schedule(struct sched_context *con, struct sched *s)
{
struct sched *last=NULL; struct sched *last=NULL;
struct sched *current=con->schedq; struct sched *current=con->schedq;
@ -203,7 +197,7 @@ static void schedule(struct sched_context *con, struct sched *s)
con->schedcnt++; con->schedcnt++;
} }
/* /*! \brief
* given the last event *tv and the offset in milliseconds 'when', * given the last event *tv and the offset in milliseconds 'when',
* computes the next value, * computes the next value,
*/ */
@ -223,11 +217,11 @@ static int sched_settime(struct timeval *tv, int when)
} }
int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable) /*! \brief
{
/*
* Schedule callback(data) to happen when ms into the future * Schedule callback(data) to happen when ms into the future
*/ */
int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable)
{
struct sched *tmp; struct sched *tmp;
int res = -1; int res = -1;
DEBUG(ast_log(LOG_DEBUG, "ast_sched_add()\n")); DEBUG(ast_log(LOG_DEBUG, "ast_sched_add()\n"));
@ -263,14 +257,14 @@ int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, vo
return ast_sched_add_variable(con, when, callback, data, 0); return ast_sched_add_variable(con, when, callback, data, 0);
} }
int ast_sched_del(struct sched_context *con, int id) /*! \brief
{
/*
* Delete the schedule entry with number * Delete the schedule entry with number
* "id". It's nearly impossible that there * "id". It's nearly impossible that there
* would be two or more in the list with that * would be two or more in the list with that
* id. * id.
*/ */
int ast_sched_del(struct sched_context *con, int id)
{
struct sched *last=NULL, *s; struct sched *last=NULL, *s;
DEBUG(ast_log(LOG_DEBUG, "ast_sched_del()\n")); DEBUG(ast_log(LOG_DEBUG, "ast_sched_del()\n"));
ast_mutex_lock(&con->lock); ast_mutex_lock(&con->lock);
@ -334,11 +328,11 @@ void ast_sched_dump(const struct sched_context *con)
} }
int ast_sched_runq(struct sched_context *con) /*! \brief
{
/*
* Launch all events which need to be run at this time. * Launch all events which need to be run at this time.
*/ */
int ast_sched_runq(struct sched_context *con)
{
struct sched *current; struct sched *current;
struct timeval tv; struct timeval tv;
int x=0; int x=0;

Loading…
Cancel
Save