You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2024/06/03 17:55:17 UTC

Re: [PR] Unit test: enable plugin dso logic to build and run unit tests. [trafficserver]

ywkaras commented on code in PR #11367:
URL: https://github.com/apache/trafficserver/pull/11367#discussion_r1624848181


##########
src/proxy/http/remap/PluginDso.cc:
##########
@@ -282,15 +282,15 @@ PluginDso::clean(std::string &error)
 void
 PluginDso::acquire()
 {
-  ++this->_instanceCount;
-  PluginDbg(_dbg_ctl(), "plugin DSO acquire (ref-count:%d, dso-addr:%p)", this->_instanceCount.load(), this);
+  this->refcount_inc();
+  PluginDbg(_dbg_ctl(), "plugin DSO acquire (ref-count:%d, dso-addr:%p)", this->refcount(), this);

Review Comment:
   Instead of reverting the use of _intanceCount (although not deleting _instanceCount),would it make more sense to delete the RefCountObjInHeap base class?
   ```
   $ git diff
   diff --git a/include/proxy/http/remap/PluginDso.h b/include/proxy/http/remap/PluginDso.h
   index e7c84e97c..2fefd208a 100644
   --- a/include/proxy/http/remap/PluginDso.h
   +++ b/include/proxy/http/remap/PluginDso.h
   @@ -50,7 +50,7 @@ namespace fs = swoc::file;
    
    #include "proxy/Plugin.h"
    
   -class PluginThreadContext : public RefCountObjInHeap
   +class PluginThreadContext
    {
    public:
      virtual void                       acquire() = 0;
   $ 
   $ cmake --build build
   [0/2] Re-checking globbed directories...
   ninja: no work to do.
   $ 
   ```
   RefCountObjInHeap is meant as a base clases for classes whose instance lifetimes will be controlled by instances of Ptr (defined in  include/tscore/Ptr.h).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org