[asterisk-dev] sleeping in a module

Kevin P. Fleming kpfleming at digium.com
Fri Aug 11 06:54:08 MST 2006


----- Thomas Andrews <tandrews at grok.co.za> wrote:
> I'm writing res_config_sqlite.c based on res_config_odbc.c and I need
> to
> know what the correct call would be to sleep if my db is busy for
> some
> reason. Should I call ast_safe_sleep() or what?

That would be the obvious answer, except that ast_safe_sleep() requires a channel pointer, and a res_config module isn't going to have one to pass in.

I think you need to find a different solution that doesn't require the res_config module to sleep at all... users of ast_realtime APIs are going to expect to get an immediate result, and if they don't then there could be really bizarre side effects.

-- 
Kevin P. Fleming
Senior Software Engineer
Digium, Inc.




More information about the asterisk-dev mailing list