Acquire/release a POSIX file lock on repository archives.
- xbps_repo_open() accepts a third argument (bool) to acquire a POSIX file lock on the repository archive. - xbps_repo_close() accepts a second argument (bool) to release a POSIX file lock on the repository archive. This avoids the issue of multiple xbps-rindex(8) processes being blocked even for different repositories on the same architecture, resulting in unnecessary contention.
This commit is contained in:
@@ -107,7 +107,7 @@ xbps_rpool_foreach(struct xbps_handle *xhp,
|
||||
xbps_array_get_cstring_nocopy(xhp->repositories, i, &repouri);
|
||||
repo = xbps_rpool_get_repo(repouri);
|
||||
if (!repo) {
|
||||
repo = xbps_repo_open(xhp, repouri);
|
||||
repo = xbps_repo_open(xhp, repouri, false);
|
||||
SIMPLEQ_INSERT_TAIL(&rpool_queue, repo, entries);
|
||||
xbps_dbg_printf(xhp, "[rpool] `%s' registered.\n", repouri);
|
||||
}
|
||||
|
Reference in New Issue
Block a user