Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(scripting/csharp): experimental SynchronizationContext (on serve…
…r) for `async void` event/refs Enable using `clr_experimental_2021_12_31_use_sync_context 'on'` in fxmanifest.lua while in preview. Please test this with a few third-party libs using Task stuff for networking.
- Loading branch information
1 parent
d57cf36
commit f78dc31
Showing
5 changed files
with
136 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,7 +210,7 @@ private void ScheduleTick(TickHandler callWrap) | |
| /// <returns>An awaitable task.</returns> | ||
| public static Task Delay(int msecs) | ||
| { | ||
| return CitizenTaskScheduler.Factory.FromAsync(BeginDelay, EndDelay, msecs, CitizenTaskScheduler.Instance); | ||
| return CitizenTaskScheduler.Factory.FromAsync(BeginDelay, EndDelay, msecs, null); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
blattersturm
Author
Collaborator
|
||
| } | ||
|
|
||
| [SecuritySafeCritical] | ||
|
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The scheduler should only be null when
clr_experimental_2021_12_31_use_sync_contextis enabled otherwise this change breaks old code.You can test it with the following code.
5104 fxserver
5149 fxserver
clr_experimental_2021_12_31_use_sync_context 'no'