[FFmpeg-devel] [PATCH 1/3] avcodec: add ff_lock/unlock_avcodec functions.

Michael Niedermayer michaelni at gmx.at
Sun Dec 2 22:57:13 CET 2012

On Sun, Dec 02, 2012 at 10:06:10PM +0100, Reimar Döffinger wrote:
> On Sun, Dec 02, 2012 at 09:37:06PM +0100, Michael Niedermayer wrote:
> > On Tue, Nov 27, 2012 at 09:59:30PM +0100, Reimar Döffinger wrote:
> > > Will be used in future patches, together with the
> > > variable that allows checking whether the lock is held.
> > 
> > cant the code be simplified to avoid 2 variables (ff_avcodec_locked
> > and entangled_thread_counter) and use just 1 ?
> Yes, it certainly would be easy to use only one.
> I just didn't consider it simpler, I consider the
> entangled_thread_counter an internal error-checking mechanism and
> I don't like the idea of exposing that to other users.
> There is also the issue of naming, whichever name I'd chose I think
> it would be confusing.
> One option I thought about was adding a check_locked function which
> does the assert instead so that the entangled_thread_counter could be
> used without exposing it, but it seemed a bit like overkill...
> But I can do whatever you prefer if that's the only concern.

hmm, if theres no clean way then choose what you prefer


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121202/5e851541/attachment.asc>

More information about the ffmpeg-devel mailing list