Skip to content

Comments

Make SQLite busy back-off logic portable#10399

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
nix-windows:portable-sleep
Apr 4, 2024
Merged

Make SQLite busy back-off logic portable#10399
Ericson2314 merged 1 commit intoNixOS:masterfrom
nix-windows:portable-sleep

Conversation

@Ericson2314
Copy link
Member

Motivation

Use C++ standard library not Unix functions for sleeping and randomness.

Context

Suggested by @edolstra in #8901 (comment)

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Use C++ standard library not Unix functions for sleeping and randomness.

Suggested by @edolstra in NixOS#8901 (comment)
@Ericson2314 Ericson2314 requested a review from thufschmitt as a code owner April 4, 2024 16:44
@Ericson2314 Ericson2314 added windows portability Supporting more platforms labels Apr 4, 2024
@Ericson2314 Ericson2314 enabled auto-merge April 4, 2024 16:45
@Ericson2314 Ericson2314 mentioned this pull request Apr 4, 2024
8 tasks
@Ericson2314 Ericson2314 merged commit 6b889e0 into NixOS:master Apr 4, 2024
@thufschmitt
Copy link
Member

@Ericson2314 Ericson2314 merged commit 6b889e0 into NixOS:master Apr 4, 2024

🙈

@Ericson2314 Ericson2314 deleted the portable-sleep branch April 4, 2024 18:47
@Ericson2314
Copy link
Member Author

I did the self-mege because I did the exact thing @edolstra requested in the other thread. It felt like he was the author and I was the reviewer --- I checked that this is in fact more portable.

lf- pushed a commit to lix-project/lix that referenced this pull request Feb 6, 2025
Use C++ standard library not Unix functions for sleeping and randomness.

Also change the PRNG seed from `clock()` to `std::random_device` because
there's no good reason not to and this avoids two threads seeding their
PRNG the same.

Upstream-PR: NixOS/nix#10399
Change-Id: I8424e7406366ea8e825d3e93dbb261ce60e3a37f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

portability Supporting more platforms windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants