Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Apr 15, 2024
1 parent 4f3a2f0 commit df5e684
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ public static void CompleteTask(JSMarshalerArgument* arguments_buffer)
}
}

// this is always running on I/O thread, so it will not throw PNSE
// it's also OK to block here, because we know we will only block shortly, as this is just race with the other thread.
if (holder.Callback != null)
{
Thread.ForceBlockingWait(static (b) => ((ManualResetEventSlim)b).Wait(), holder.CallbackReady);
}

holder.CallbackReady?.Wait();

lock (ctx)
Expand Down

0 comments on commit df5e684

Please sign in to comment.