Sergio Garcia Murillo schrieb: > From: Klaus Darilion [mailto:[EMAIL PROTECTED] >> Sergio Garcia Murillo wrote: >>> From: "Simon Perreault" <[EMAIL PROTECTED]> >>>> Either I'm getting it all wrong, or I have an even bigger problem than I >>> first >>>> thought. And my code is largely inspired from Sergio's on >>> sip.fontventa.com >>>> so we'd be two. ;) >>>> >>> I've changed all my allocations to be static, so I just avoided the issue... >> Are static buffers thread safe? > > From previous answers I assume that within an application the frame is only > acceses while the ast_write is executed. So it would be safe to do something > like that: > > struct ast_frame *f = (struct ast_frame*)malloc(sizeof(ast_frame)); > ast_write(f); > free(f) > > In that case that > > unsigned char aux[sizeof(ast_frame)]; > struct ast_frame *f = (struct ast_frame*)aux; > ast_write(aux); > > would be equally thread safe.
True, but I thought it is a "static" buffer, like: static unsigned char aux[sizeof(ast_frame)]; ? regards klaus > If asterisk would like to make anything weird with the frame (like some kind > of > jitter buffering or delay sending) it should duplicate the whole frame and > take > care of the clone. > > Best regards > Sergio > > > > ------------------------------------------------------------------------ > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-dev mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-dev _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
