Skip to content

Commit

Permalink
fix: dead lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Delusoire committed Aug 10, 2024
1 parent a515559 commit 5dcea0b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,16 @@ export class Module extends ModuleBase<Module, ModuleInstance> {
}

public async fastEnable(instance: ModuleInstance): Promise<boolean> {
return instance.transition.new(async () => {
const enabledInstance = this.getEnabledInstance();
let enabledInstance = this.getEnabledInstance();
if (enabledInstance === instance) {
await enabledInstance?.transition.block();
}

return instance.transition.new(async () => {
enabledInstance = this.getEnabledInstance();
if (enabledInstance !== instance) {
await enabledInstance?.transition.block();
}

if (
instance.isEnabled() ||
Expand Down

0 comments on commit 5dcea0b

Please sign in to comment.