initialize free lists when starting dbChannel
This commit is contained in:
@@ -68,6 +68,7 @@ void dbChannelInit (void)
|
||||
freeListInitPvt(&dbChannelFreeList, sizeof(dbChannel), 128);
|
||||
freeListInitPvt(&chFilterFreeList, sizeof(chFilter), 64);
|
||||
freeListInitPvt(&dbchStringFreeList, sizeof(epicsOldString), 128);
|
||||
db_init_event_freelists();
|
||||
}
|
||||
|
||||
static void chf_value(parseContext *parser, parse_result *presult)
|
||||
|
||||
@@ -252,18 +252,15 @@ int dbel ( const char *pname, unsigned level )
|
||||
}
|
||||
|
||||
/*
|
||||
* DB_INIT_EVENTS()
|
||||
* DB_INIT_EVENT_FREELISTS()
|
||||
*
|
||||
*
|
||||
* Initialize the event facility for this task. Must be called at least once
|
||||
* by each task which uses the db event facility
|
||||
* Initialize the free lists used by the event facility.
|
||||
* Safe to be called multiple times.
|
||||
*
|
||||
* returns: ptr to event user block or NULL if memory can't be allocated
|
||||
*/
|
||||
dbEventCtx db_init_events (void)
|
||||
void db_init_event_freelists (void)
|
||||
{
|
||||
struct event_user * evUser;
|
||||
|
||||
if (!dbevEventUserFreeList) {
|
||||
freeListInitPvt(&dbevEventUserFreeList,
|
||||
sizeof(struct event_user),8);
|
||||
@@ -280,6 +277,22 @@ dbEventCtx db_init_events (void)
|
||||
freeListInitPvt(&dbevFieldLogFreeList,
|
||||
sizeof(struct db_field_log),2048);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* DB_INIT_EVENTS()
|
||||
*
|
||||
*
|
||||
* Initialize the event facility for this task. Must be called at least once
|
||||
* by each task which uses the db event facility
|
||||
*
|
||||
* returns: ptr to event user block or NULL if memory can't be allocated
|
||||
*/
|
||||
dbEventCtx db_init_events (void)
|
||||
{
|
||||
struct event_user * evUser;
|
||||
|
||||
db_init_event_freelists();
|
||||
|
||||
evUser = (struct event_user *)
|
||||
freeListCalloc(dbevEventUserFreeList);
|
||||
|
||||
@@ -51,6 +51,7 @@ epicsShareFunc int db_post_events (
|
||||
typedef void * dbEventCtx;
|
||||
|
||||
typedef void EXTRALABORFUNC (void *extralabor_arg);
|
||||
void db_init_event_freelists (void);
|
||||
epicsShareFunc dbEventCtx db_init_events (void);
|
||||
epicsShareFunc int db_start_events (
|
||||
dbEventCtx ctx, const char *taskname, void (*init_func)(void *),
|
||||
|
||||
Reference in New Issue
Block a user