Skip to content

Commit

Permalink
Merge 6f340a8 into 3293a29
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jan 22, 2023
2 parents 3293a29 + 6f340a8 commit ed6cd7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/database/src/ioc/db/dbEvent.c
Expand Up @@ -934,6 +934,7 @@ void db_post_single_event (dbEventSubscription event)
static int event_read ( struct event_que *ev_que )
{
db_field_log *pfl;
int notifiedRemaining = 0;
void ( *user_sub ) ( void *user_arg, struct dbChannel *chan,
int eventsRemaining, db_field_log *pfl );

Expand All @@ -955,6 +956,7 @@ static int event_read ( struct event_que *ev_que )

while ( ev_que->evque[ev_que->getix] != EVENTQEMPTY ) {
struct evSubscrip *pevent = ev_que->evque[ev_que->getix];
int eventsRemaining;

pfl = ev_que->valque[ev_que->getix];
if ( pevent == &canceledEvent ) {
Expand All @@ -977,6 +979,7 @@ static int event_read ( struct event_que *ev_que )

event_remove ( ev_que, ev_que->getix, EVENTQEMPTY );
ev_que->getix = RNGINC ( ev_que->getix );
eventsRemaining = ev_que->evque[ev_que->getix] != EVENTQEMPTY && !ev_que->nCanceled;

/*
* create a local copy of the call back parameters while
Expand Down Expand Up @@ -1009,7 +1012,8 @@ static int event_read ( struct event_que *ev_que )
if (pfl) {
/* Issue user callback */
( *user_sub ) ( pevent->user_arg, pevent->chan,
ev_que->evque[ev_que->getix] != EVENTQEMPTY, pfl );
eventsRemaining, pfl );
notifiedRemaining = eventsRemaining;
}
LOCKEVQUE (ev_que);

Expand Down Expand Up @@ -1038,6 +1042,9 @@ static int event_read ( struct event_que *ev_que )

UNLOCKEVQUE (ev_que);

if(notifiedRemaining)
errlogPrintf(ERL_WARNING " dbEvent possible queue stall\n");

return DB_EVENT_OK;
}

Expand Down

0 comments on commit ed6cd7d

Please sign in to comment.