\brief Adds a send right to the pool. \param[in] send_right The send right to be added. The pool object takes its own reference to the send right, which remains valid until the pool object is destroyed. The caller remains responsible for its reference to the send right. It is possible and in fact likely that one pool will wind up owning the same send right multiple times. This is acceptable, bec
| 85 | //! same send right multiple times. This is acceptable, because send rights |
| 86 | //! are reference-counted. |
| 87 | void AddSendRight(mach_port_t send_right) { |
| 88 | kern_return_t kr = mach_port_mod_refs(mach_task_self(), |
| 89 | send_right, |
| 90 | MACH_PORT_RIGHT_SEND, |
| 91 | 1); |
| 92 | MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_mod_refs"; |
| 93 | |
| 94 | send_rights_.push_back(send_right); |
| 95 | } |
| 96 | |
| 97 | private: |
| 98 | std::vector<mach_port_t> send_rights_; |
no test coverage detected