You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ma...@apache.org on 2021/08/18 21:30:35 UTC

[incubator-mxnet] branch v1.9.x updated: [v1.9.x] stop closing opened libs (#20523)

This is an automated email from the ASF dual-hosted git repository.

manuseth pushed a commit to branch v1.9.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/v1.9.x by this push:
     new b5e9ae8  [v1.9.x] stop closing opened libs (#20523)
b5e9ae8 is described below

commit b5e9ae89bb5a4232875cd354ffe9a091b43bba69
Author: Sam Skalicky <sa...@gmail.com>
AuthorDate: Wed Aug 18 14:28:16 2021 -0700

    [v1.9.x] stop closing opened libs (#20523)
    
    * stopped closing opened libs
    
    * removed return handling from load
    
    * missed one *lib
    
    Co-authored-by: Skalicky <ss...@3c22fb4b1091.ant.amazon.com>
---
 include/mxnet/c_api.h   | 2 +-
 python/mxnet/library.py | 2 +-
 src/c_api/c_api.cc      | 2 ++
 src/initialize.cc       | 4 ----
 src/initialize.h        | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/mxnet/c_api.h b/include/mxnet/c_api.h
index 67751a4..22afd4f 100644
--- a/include/mxnet/c_api.h
+++ b/include/mxnet/c_api.h
@@ -233,7 +233,7 @@ MXNET_DLL const char *MXGetLastError();
 /*!
  * \brief Load library dynamically
  * \param path to the library .so file
- * \param 0 for quiet, 1 for verbose
+ * \param verbose 0 for quiet, 1 for verbose
  * \return 0 when success, -1 when failure happens.
  */
 MXNET_DLL int MXLoadLib(const char *path, unsigned verbose);
diff --git a/python/mxnet/library.py b/python/mxnet/library.py
index e0c60d4..da16af2 100644
--- a/python/mxnet/library.py
+++ b/python/mxnet/library.py
@@ -37,7 +37,7 @@ def load(path, verbose=True):
 
     Returns
     ---------
-    void
+    None
     """
     #check if path exists
     if not os.path.exists(path):
diff --git a/src/c_api/c_api.cc b/src/c_api/c_api.cc
index 569564a..78c7b29 100644
--- a/src/c_api/c_api.cc
+++ b/src/c_api/c_api.cc
@@ -1514,6 +1514,8 @@ void registerPasses(void *lib, int verbose, mxnet::ext::msgSize_t msgSize,
 /*!
  * \brief Loads dynamic custom library and initializes it
  * \param path library path
+ * \param verbose 0 for quiet, 1 for verbose
+ * \return 0 when success, -1 when failure happens.
  */
 int MXLoadLib(const char *path, unsigned verbose) {
   API_BEGIN();
diff --git a/src/initialize.cc b/src/initialize.cc
index 84195f9..e06f905 100644
--- a/src/initialize.cc
+++ b/src/initialize.cc
@@ -96,10 +96,6 @@ LibraryInitializer::LibraryInitializer()
   install_pthread_atfork_handlers();
 }
 
-LibraryInitializer::~LibraryInitializer() {
-  close_open_libs();
-}
-
 bool LibraryInitializer::lib_is_loaded(const std::string& path) const {
   return loaded_libs.count(path) > 0;
 }
diff --git a/src/initialize.h b/src/initialize.h
index f12b2f6..04e2322 100644
--- a/src/initialize.h
+++ b/src/initialize.h
@@ -56,7 +56,7 @@ class LibraryInitializer {
    */
   LibraryInitializer();
 
-  ~LibraryInitializer();
+  ~LibraryInitializer() = default;
 
   /**
    * @return true if the current pid doesn't match the one that initialized the library