Skip to content

Is load_ref_count_ no need to count number? #171

Description

@daohu527

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);

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions