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); |
There is a lock
load_ref_lockandclass_loader::impl::loadLibrary(getLibraryPath(), this)will not load .so library twice. Why not just use a boolis_loadedto load and unload the .so library.I didn't see the benefits of counting times of the
loadLibrary. TheunloadLibrarywill do nothing whenload_ref_count_ > 0too.class_loader/src/class_loader.cpp
Lines 100 to 102 in a183b76