| 70 | } |
| 71 | |
| 72 | VariableInfo::~VariableInfo() { |
| 73 | // Release the variable's lock if we hold it. Ensures that the lock is |
| 74 | // released even on error. It does not matter in what order we release the |
| 75 | // locks. |
| 76 | if (var()) { |
| 77 | if (lock_held()) { |
| 78 | var()->mu()->unlock(); |
| 79 | } |
| 80 | |
| 81 | // Unref the variable so it can be released by ResourceManager. |
| 82 | var()->Unref(); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // Returns a vector of VaribleInfo instances for the resource variable inputs to |
| 87 | // the kernel with context `ctx`. The input indices for the resource variable |