Asterisk - The Open Source Telephony Project GIT-master-2de1a68
Functions | Variables
general.c File Reference
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/sched.h"
#include "general.h"
Include dependency graph for general.c:

Go to the source code of this file.

Functions

void aeap_general_finalize (void)
 Finalize/cleanup general AEAP facilities. More...
 
int aeap_general_initialize (void)
 Initialize general/common AEAP facilities. More...
 
struct ast_sched_contextaeap_sched_context (void)
 Retrieve the scheduling context. More...
 

Variables

static struct ast_sched_contextsched = NULL
 Scheduler for transaction timeouts. More...
 

Function Documentation

◆ aeap_general_finalize()

void aeap_general_finalize ( void  )

Finalize/cleanup general AEAP facilities.

Definition at line 34 of file general.c.

35{
36 if (sched) {
38 sched = NULL;
39 }
40}
#define NULL
Definition: resample.c:96
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
Definition: sched.c:271
Definition: sched.c:76

References ast_sched_context_destroy(), and NULL.

Referenced by aeap_general_initialize(), and unload_module().

◆ aeap_general_initialize()

int aeap_general_initialize ( void  )

Initialize general/common AEAP facilities.

Returns
0 on success, -1 on error

Definition at line 42 of file general.c.

43{
45 if (!sched) {
46 ast_log(LOG_ERROR, "AEAP scheduler: unable to create context");
47 return -1;
48 }
49
51 ast_log(LOG_ERROR, "AEAP scheduler: unable to start thread");
53 return -1;
54 }
55
56 return 0;
57}
#define ast_log
Definition: astobj2.c:42
void aeap_general_finalize(void)
Finalize/cleanup general AEAP facilities.
Definition: general.c:34
#define LOG_ERROR
int ast_sched_start_thread(struct ast_sched_context *con)
Start a thread for processing scheduler entries.
Definition: sched.c:197
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
Definition: sched.c:238

References aeap_general_finalize(), ast_log, ast_sched_context_create(), ast_sched_start_thread(), and LOG_ERROR.

Referenced by load_module().

◆ aeap_sched_context()

struct ast_sched_context * aeap_sched_context ( void  )

Retrieve the scheduling context.

Returns
The scheduling context

Definition at line 29 of file general.c.

30{
31 return sched;
32}
static struct ast_sched_context * sched
Scheduler for transaction timeouts.
Definition: general.c:27

References sched.

Referenced by aeap_transaction_cancel_timer(), and transaction_sched_timer().

Variable Documentation

◆ sched

struct ast_sched_context* sched = NULL
static

Scheduler for transaction timeouts.

Definition at line 27 of file general.c.

Referenced by aeap_sched_context().