subsys: random: Fix semaphore initial count of xoroshiro128
Semaphore state_sem initial count is set to 0 but k_sem_give() is invoked first in sys_rand32_get() which will block the caller forever. Fix the issue by setting the initail count to count_limit. Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This commit is contained in:
parent
08ce2bb37f
commit
a895d21d63
1 changed files with 1 additions and 1 deletions
|
@ -43,7 +43,7 @@
|
||||||
static u64_t state[2];
|
static u64_t state[2];
|
||||||
static bool initialized;
|
static bool initialized;
|
||||||
|
|
||||||
K_SEM_DEFINE(state_sem, 0, 1);
|
K_SEM_DEFINE(state_sem, 1, 1);
|
||||||
|
|
||||||
static inline u64_t rotl(const u64_t x, int k)
|
static inline u64_t rotl(const u64_t x, int k)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue