| 645 | } |
| 646 | |
| 647 | RPCService *Plugin::rpc_connect(color_ostream &out) |
| 648 | { |
| 649 | RPCService *rv = NULL; |
| 650 | |
| 651 | access->lock_add(); |
| 652 | |
| 653 | if(state == PS_LOADED && plugin_rpcconnect) |
| 654 | { |
| 655 | rv = plugin_rpcconnect(out); |
| 656 | } |
| 657 | |
| 658 | if (rv) |
| 659 | { |
| 660 | // Retain the access reference |
| 661 | assert(!rv->holder); |
| 662 | services.push_back(rv); |
| 663 | rv->holder = this; |
| 664 | return rv; |
| 665 | } |
| 666 | else |
| 667 | { |
| 668 | access->lock_sub(); |
| 669 | return NULL; |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | void Plugin::detach_connection(RPCService *svc) |
| 674 | { |
no test coverage detected