MCPcopy Create free account
hub / github.com/apache/trafficserver / deletePluginInstance

Method deletePluginInstance

plugins/origin_server_auth/origin_server_auth.cc:661–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661void
662S3Config::deletePluginInstance(S3Config *s3)
663{
664 // Due to a race conditions with the background continuation
665 // the plugin shutdown has to take care not to run
666 // when the reload continuation does.
667 //
668 // The order of oprations here is important, be careful making changes
669 if (s3) {
670 TSMutex s3_mutex_ptr = s3->config_reloader_mutex();
671
672 TSMutexLock(s3_mutex_ptr);
673 auto cont = s3->releaseReloadCont();
674 delete s3;
675 TSMutexUnlock(s3_mutex_ptr);
676 // Its important to only destory this continuation outside of holding
677 // its lock, but after it has been cancelled (in the S3Config destructor)
678 if (cont != nullptr) {
679 TSContDestroy(cont);
680 }
681 }
682}
683
684///////////////////////////////////////////////////////////////////////////////
685// Implementation for the ConfigCache, it has to go here since we have a sort

Callers

nothing calls this directly

Calls 5

TSMutexLockFunction · 0.85
TSMutexUnlockFunction · 0.85
TSContDestroyFunction · 0.85
config_reloader_mutexMethod · 0.80
releaseReloadContMethod · 0.80

Tested by

no test coverage detected