HomeFreeBSD

- Make sure random_adaptor accesses happen only when

Description

  • Make sure random_adaptor accesses happen only when random_adaptors_lock is held.
  • Use sx_sleep instead of tsleep in read and write path to allow another thread that registers a new random adapter when waiting. Assert that random_adaptor is not NULL after reacquiring the lock.
  • Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be stopped when user requests so, while there also make short read/write's return 0.
  • Move M_WAITOK allocations out of lock scope.

In collobration with: kib, markm, ian, jilles
Reviewed by: kib, markm
Approved by: so

Details

Provenance
delphijAuthored on
Reviewer
markm
Parents
rS273996: MFC 273644,273738:
Branches
Unknown
Tags
Unknown

Event Timeline