| 659 | } |
| 660 | |
| 661 | void |
| 662 | S3Config::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 |
nothing calls this directly
no test coverage detected