freetdm: core - lock the channel on ftdm_channel_read_event()

ftmod_zt - not locking the channel on zt_channel_next_event(), minor changes
This commit is contained in:
Arnaldo Pereira
2010-12-21 16:32:02 -02:00
parent 7732a67598
commit 723a598c24
2 changed files with 11 additions and 5 deletions
+7 -2
View File
@@ -1142,14 +1142,17 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read_event(ftdm_channel_t *ftdmchan, ftdm
ftdm_span_t *span = ftdmchan->span;
ftdm_assert_return(span->fio != NULL, FTDM_FAIL, "No I/O module attached to this span!\n");
ftdm_channel_lock(ftdmchan);
if (!span->fio->channel_next_event) {
ftdm_log(FTDM_LOG_ERROR, "channel_next_event method not implemented in module %s!", span->fio->name);
return FTDM_NOTIMPL;
status = FTDM_NOTIMPL;
goto done;
}
status = span->fio->channel_next_event(ftdmchan, event);
if (status != FTDM_SUCCESS) {
return status;
goto done;
}
/* before returning the event to the user we do some core operations with certain OOB events */
@@ -1177,6 +1180,8 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read_event(ftdm_channel_t *ftdmchan, ftdm
break;
}
done:
ftdm_channel_unlock(ftdmchan);
return status;
}