Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is load_ref_count_ no need to count number? #171

Open
daohu527 opened this issue Oct 24, 2020 · 0 comments
Open

Is load_ref_count_ no need to count number? #171

daohu527 opened this issue Oct 24, 2020 · 0 comments

Comments

@daohu527
Copy link

daohu527 commented Oct 24, 2020

There is a lock load_ref_lock and class_loader::impl::loadLibrary(getLibraryPath(), this) will not load .so library twice. Why not just use a bool is_loaded to load and unload the .so library.

I didn't see the benefits of counting times of the loadLibrary. The unloadLibrary will do nothing when load_ref_count_ > 0 too.

boost::recursive_mutex::scoped_lock lock(load_ref_count_mutex_);
load_ref_count_ = load_ref_count_ + 1;
class_loader::impl::loadLibrary(getLibraryPath(), this);

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

No branches or pull requests

1 participant