Skip to content

xbps-remove --clean-cache#661

Open
Duncaen wants to merge 3 commits intovoid-linux:masterfrom
Duncaen:xbps-remove-rpool-multithreaded
Open

xbps-remove --clean-cache#661
Duncaen wants to merge 3 commits intovoid-linux:masterfrom
Duncaen:xbps-remove-rpool-multithreaded

Conversation

@Duncaen
Copy link
Member

@Duncaen Duncaen commented Dec 7, 2025

No description provided.

Comment on lines +151 to +156
// XXX: same for the repository pool...
if (uninstalled) {
(void)xbps_pkgdb_get_pkg(xhp, "foo");
} else {
(void)xbps_rpool_get_pkg(xhp, "package-that-wont-exist-so-it-loads-all-repos");
}
Copy link

@domsim1 domsim1 Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to make xbps_pkgdb_init and xbps_rpool_init thread-safe with pthread_mutex_t? This would eliminate the need for workarounds and make lazy initialization work safely whether called from single-threaded or multithreaded code. The performance overhead should be negligible since the mutex is only contended during the initial load.

This would also help prevent similar issues.

Happy to take a stab at implementing this if you think it's worthwhile.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan was to remove the lazy initialization instead.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that too, although it will be a breaking API change. How is something like that normally coordinated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants