Ensure proper per thread seeding in KRandom.

Authored by tfry on May 24 2017, 8:55 PM.

Description

Ensure proper per thread seeding in KRandom.

Summary:
Currently only the first thread to call KRandom::random() will call qsrand()
with a suitable seed. Later threads will use qsrand(1), implicitly.

Instead, use QThreadStorage to keep track to seeding per thread.

Reviewers: dfaure

Subscribers: mpyne, tfry, rjvbb, Frameworks

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D5966

Details

Committed
tfryMay 29 2017, 6:14 PM
Differential Revision
D5966: Fix race-condition in KRandom-seeding.
Parents
R244:7004da387341: API dox: in example use KDBusService only after commandline is handled
Branches
Unknown
Tags
Unknown