|
Threads-Devel : |
From: Yaser Zhian Tabasy (yaserzt_at_[hidden])
Date: 2007-07-07 03:35:17
Ruediger Berlich wrote:
> just a short question about the usage of scoped_lock in inline functions. Is
> it correct that, depending on whether a function is accepted as inline or
> not by the compiler, a scoped_lock might actually remain active ? I.e.,
> does the scope of a function end even if it is inlined in other code ?
You should not worry. The compiler generates correct code even if
the function is inlined (at least the ones I use do.)
I'm not sure about this part, but I think it's possible that in some
cases (maybe when exception handling is involved,) the compiler
might not be able to inline the function at all.
I think if any compiler did not generate destructors for inlined
functions, the results would be obvious in the piles of code that
wouldn't function at all.
> Best Regards,
> Ruediger
>
-Yaser
-- "Programming is an art that fights back!"