Patent ID: 7865914

Claim:
A method for enabling a computing device having a loader lock to load and unload a plurality of libraries, the method comprising: maintaining an internal count and external count for libraries of the plurality of libraries; and using the internal and external counts to determine when to load and unload the libraries of the plurality of libraries, wherein using the internal and external counts to determine when to load and unload the libraries of the plurality of libraries comprises: when a library is called, placing the library into an initialize state in which the internal count of the library is set to zero and the external count of the library is set to greater than zero; when the library is initialized, incrementing the internal count; when the internal count in incremented, placing the library in an initialized state; when the external count is decremented to zero, placing the library in a pending unload state; when the internal count is decremented to zero, placing the library in an unload state; and unloading the library when the library is in the unload state.