It's hard to guess without the claimed path. What's your tools output?
But anyhow, just by looking at the code, it looks right.
On 14 Dec 2012 11:27, "Stefan Schmidt" <[email protected]> wrote:
> Hello.
>
> We have tons of reports from a static analyser here about the
> EO_DEFINE_CLASS macro. Actually in every place it is used. :)
>
> The analyser thinks that _my_lock.mutex is locked but not unlocked.
> I had a look at the code as well as cedric and we are both confused now. :)
>
> It would be great if someone else can have a look at this. Tom, Daniel?
>
> Its efl/src/lib/eo/Eo.h:190
>
> #define EO_DEFINE_CLASS(class_get_func_name, class_desc, parent_class,
> ...) \
> EAPI const Eo_Class * \
> class_get_func_name(void) \
> { \
> const Eo_Class *_tmp_parent_class; \
> static volatile char lk_init = 0; \
> static Eina_Lock _my_lock; \
> static const Eo_Class * volatile _my_class = NULL; \
> if (EINA_LIKELY(!!_my_class)) return _my_class; \
> \
> eina_lock_take(&_eo_class_creation_lock); \
> if (!lk_init) \
> eina_lock_new(&_my_lock); \
> if (lk_init < 2) eina_lock_take(&_my_lock); \
> if (!lk_init) \
> lk_init = 1; \
> else \
> { \
> if (lk_init < 2) eina_lock_release(&_my_lock); \
> eina_lock_release(&_eo_class_creation_lock); \
> return _my_class; \
> } \
> eina_lock_release(&_eo_class_creation_lock); \
> _tmp_parent_class = parent_class; \
> _my_class = eo_class_new(class_desc, _tmp_parent_class, __VA_ARGS__); \
> eina_lock_release(&_my_lock); \
> \
> eina_lock_take(&_eo_class_creation_lock); \
> eina_lock_free(&_my_lock); \
> lk_init = 2; \
> eina_lock_release(&_eo_class_creation_lock); \
> return _my_class; \
> }
>
> regards
> Stefan Schmidt
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel