Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throughout the code base reference counting is done in a thread-unsave way. Turn nrefs into atomic_int so they are thread-save themselves. As the nref can't change again after reaching zero this is thread-save even as we look at the result an instruction later. FD_t is special in that fdFree return the instance after free iff it still has not reached a ref count of 0. Unfortunately code in rpmShowProgress() relies on that. This does not make the data structures thread save on its own. But it gives a foundation on which data locking can be implemented.
- Loading branch information