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:
Ramakrishna Pallala 2017-11-15 12:53:38 -05:00 committed by Kumar Gala
commit a895d21d63

View file

@ -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)
{ {