| 546 | } |
| 547 | |
| 548 | command_result Plugin::on_update(color_ostream &out) |
| 549 | { |
| 550 | // Check things that are implicitly protected by the suspend lock |
| 551 | if (!plugin_onupdate) |
| 552 | return CR_NOT_IMPLEMENTED; |
| 553 | if (plugin_is_enabled && !*plugin_is_enabled) |
| 554 | return CR_OK; |
| 555 | // Grab mutex and call the thing |
| 556 | command_result cr = CR_NOT_IMPLEMENTED; |
| 557 | access->lock_add(); |
| 558 | if(state == PS_LOADED && plugin_onupdate) |
| 559 | { |
| 560 | cr = plugin_onupdate(out); |
| 561 | Lua::Core::Reset(out, "plugin_onupdate"); |
| 562 | } |
| 563 | access->lock_sub(); |
| 564 | return cr; |
| 565 | } |
| 566 | |
| 567 | command_result Plugin::set_enabled(color_ostream &out, bool enable) |
| 568 | { |