]> granicus.if.org Git - esp-idf/commit
newlib locks: Fix _lock_init() & _lock_init_recursive() failing to initialise a lock
authorAngus Gratton <angus@espressif.com>
Thu, 29 Jun 2017 11:30:28 +0000 (21:30 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 29 Jun 2017 22:54:56 +0000 (08:54 +1000)
commit75d6fdf73c272690a97e63456b03a978362aa04f
tree37ce6502acf0bbeea87111a58a53d48109ea23f9
parent9b955f4c9f1b32652ea165d3e4cdaad01bba170e
newlib locks: Fix _lock_init() & _lock_init_recursive() failing to initialise a lock

If scheduler was running, and lock was an automatic variable (ie stack-allocated) to be initialised by _lock_init*,
initialisation could be skipped if the lock variable was non-zero (and lock would be left invalid).

In other cases the lock is statically initialised to zero by __LOCK_INIT*
components/newlib/locks.c