Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b0ae33

Browse files
committed
Merge pull requestfsharp#102 from ovatsus/master
Add support for profile 88 ('portable-net4+sl4+wp71+win8')
2 parents2412a42 +644fd4a commit5b0ae33

File tree

7 files changed

+149
-17
lines changed

7 files changed

+149
-17
lines changed

‎FSharp.Core.Portable.sln‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 2012
3+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") ="FSharp.Core.Portable","fsharp\FSharp.Core\FSharp.Core.Portable.fsproj","{DED3BBD7-53F4-428A-8C9F-27968E768605}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) =preSolution
7+
Debug|Any CPU=Debug|Any CPU
8+
Release|Any CPU=Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) =postSolution
11+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.ActiveCfg=Debug|x86
12+
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg=Release|x86
13+
EndGlobalSection
14+
GlobalSection(SolutionProperties) =preSolution
15+
HideSolutionNode =FALSE
16+
EndGlobalSection
17+
EndGlobal

‎README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ sudo make install
3737
```
3838
cd src
3939
msbuild fsharp-proto-build.proj
40+
ngen install ..\lib\proto\4.0\fsc-proto.exe (optional)
4041
msbuild fsharp-library-build.proj
4142
msbuild fsharp-compiler-build.proj
4243
```
43-
You can also build the FSharp.Core for .NET 2.0, Mono 2.1, Silverlight 5.0, Portable Profile47 (net4+sl4+wp71+win8) and XNA 4.0 for Xbox 360 profiles:
44+
You can also build the FSharp.Core for .NET 2.0, Mono 2.1, Silverlight 5.0,Windows Phone 7.1,Portable Profile47 (net45+sl5+win8), Portable Profile88 (net4+sl4+wp71+win8) and XNA 4.0 for Xbox 360 profiles:
4445
```
4546
msbuild fsharp-library-build.proj /p:TargetFramework=net20
4647
msbuild fsharp-library-build.proj /p:TargetFramework=mono21
48+
msbuild fsharp-library-build.proj /p:TargetFramework=portable-net45+sl5+win8
4749
msbuild fsharp-library-build.proj /p:TargetFramework=portable-net4+sl4+wp71+win8
4850
msbuild fsharp-library-build.proj /p:TargetFramework=sl5
51+
msbuild fsharp-library-build.proj /p:TargetFramework=wp7
4952
msbuild fsharp-library-build.proj /p:TargetFramework=net40-xna40-xbox360
5053
```
5154
You can also build the FSharp.Core and FSharp.Compiler.Silverlight.dll for Silverlight 5.0:

‎src/FSharpSource.targets‎

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<VersionFileCondition="'$(TargetFramework)' == 'net20'">$(FSharpSourcesRoot)\source-build-version-2.3.0.0</VersionFile>
2424
<VersionFileCondition="'$(TargetFramework)' == 'net40'">$(FSharpSourcesRoot)\source-build-version-4.3.0.0</VersionFile>
2525
<VersionFileCondition="'$(TargetFramework)' == 'portable-net4+sl4+wp71+win8'">$(FSharpSourcesRoot)\source-build-version-2.3.5.0</VersionFile>
26+
<VersionFileCondition="'$(TargetFramework)' == 'portable-net45+sl5+win8'">$(FSharpSourcesRoot)\source-build-version-2.3.5.0</VersionFile>
2627
<!--
2728
Some other NuGET monikers to support in the future, see http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Package_Conventions
2829
@@ -131,11 +132,73 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
131132
<AssemblySearchPaths>$(FSharpSourcesRoot)\..\dependencies\mono\2.1;$(AssemblySearchPaths)</AssemblySearchPaths>
132133
</PropertyGroup>
133134

135+
<!-- Target Portable-->
136+
<PropertyGroupCondition="'$(TargetFramework)'=='portable-net45+sl5+win8'">
137+
138+
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
139+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
140+
<TargetFrameworkOutputDirectory>$(TargetFramework)</TargetFrameworkOutputDirectory>
141+
142+
<DefineConstants>$(DefineConstants);FSHARP_CORE_PORTABLE</DefineConstants>
143+
<DefineConstants>$(DefineConstants);FX_NO_CONCURRENT_DICTIONARY</DefineConstants>
144+
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
145+
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
146+
<DefineConstants>$(DefineConstants);FX_NO_DEBUG_PROXIES</DefineConstants>
147+
<DefineConstants>$(DefineConstants);FX_NO_EXIT</DefineConstants>
148+
<DefineConstants>$(DefineConstants);FX_NO_CHAR_PARSE</DefineConstants>
149+
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
150+
<DefineConstants>$(DefineConstants);FX_SIMPLE_SECURITY_PERMISSIONS</DefineConstants>
151+
<DefineConstants>$(DefineConstants);FX_NO_TRUNCATE</DefineConstants>
152+
<DefineConstants>$(DefineConstants);FX_NO_CULTURE_INFO_ARGS</DefineConstants>
153+
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_MODULES</DefineConstants>
154+
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_METADATA_TOKENS</DefineConstants>
155+
<DefineConstants>$(DefineConstants);FX_NO_TO_LOWER_INVARIANT</DefineConstants>
156+
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
157+
<DefineConstants>$(DefineConstants);FX_NO_BASED_ARRAYS</DefineConstants>
158+
<DefineConstants>$(DefineConstants);FX_NO_DOUBLE_BIT_CONVERTER</DefineConstants>
159+
<DefineConstants>$(DefineConstants);FX_NO_BINARY_SERIALIZATION</DefineConstants>
160+
<DefineConstants>$(DefineConstants);FX_NO_ASCII_ENCODING</DefineConstants>
161+
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_ENCODING</DefineConstants>
162+
<DefineConstants>$(DefineConstants);FX_NO_FILE_OPTIONS</DefineConstants>
163+
<DefineConstants>$(DefineConstants);FX_NO_NONBLOCK_IO</DefineConstants>
164+
<DefineConstants>$(DefineConstants);FX_NO_COMMAND_LINE_ARGS</DefineConstants>
165+
<DefineConstants>$(DefineConstants);FX_NO_ENVIRONMENT</DefineConstants>
166+
<DefineConstants>$(DefineConstants);FX_NO_PROCESS_START</DefineConstants>
167+
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
168+
<DefineConstants>$(DefineConstants);FX_NO_PROCESS_DIAGNOSTICS</DefineConstants>
169+
<DefineConstants>$(DefineConstants);FX_NO_IOBSERVABLE</DefineConstants>
170+
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
171+
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
172+
<DefineConstants>$(DefineConstants);FX_NO_GET_HASH_CODE_HELPER</DefineConstants>
173+
<DefineConstants>$(DefineConstants);FX_NO_COMVISIBLE</DefineConstants>
174+
<DefineConstants>$(DefineConstants);FX_NO_ICLONEABLE</DefineConstants>
175+
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
176+
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONSOLE</DefineConstants>
177+
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_KEY_SORT</DefineConstants>
178+
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_EMIT</DefineConstants>
179+
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
180+
<DefineConstants>$(DefineConstants);FX_EVENTWAITHANDLE_NO_IDISPOSABLE</DefineConstants>
181+
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
182+
<DefineConstants>$(DefineConstants);FX_ATLEAST_LINQ</DefineConstants>
183+
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
184+
<DefineConstants>$(DefineConstants);FX_NO_THREADPOOL</DefineConstants>
185+
<DefineConstants>$(DefineConstants);FX_NO_WAITONE_MILLISECONDS</DefineConstants>
186+
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
187+
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
188+
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
189+
<DefineConstants>$(DefineConstants);FX_NO_BIGINT</DefineConstants>
190+
<DefineConstants>$(DefineConstants);DONT_INCLUDE_DEPRECATED</DefineConstants>
191+
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
192+
193+
<AssemblySearchPaths>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)</AssemblySearchPaths>
194+
<OtherFlags>$(OtherFlags) --simpleresolution -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\mscorlib.dll" -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\System.dll" -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\System.Core.dll"</OtherFlags>
195+
196+
</PropertyGroup>
134197

135198
<!-- Target Portable-->
136199
<PropertyGroupCondition="'$(TargetFramework)'=='portable-net4+sl4+wp71+win8'">
137200

138-
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
201+
<TargetFrameworkProfile>Profile88</TargetFrameworkProfile>
139202
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
140203
<TargetFrameworkOutputDirectory>$(TargetFramework)</TargetFrameworkOutputDirectory>
141204

@@ -190,6 +253,17 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
190253
<DefineConstants>$(DefineConstants);DONT_INCLUDE_DEPRECATED</DefineConstants>
191254
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE</DefineConstants>
192255

256+
<DefineConstants>$(DefineConstants);FX_NO_STRUCTURAL_EQUALITY</DefineConstants>
257+
<DefineConstants>$(DefineConstants);FX_NO_CANCELLATIONTOKEN_CLASSES</DefineConstants>
258+
<DefineConstants>$(DefineConstants);FX_NO_LAZY</DefineConstants>
259+
<DefineConstants>$(DefineConstants);FX_NO_TUPLE</DefineConstants>
260+
<DefineConstants>$(DefineConstants);FX_NO_TASK</DefineConstants>
261+
<DefineConstants>$(DefineConstants);FX_NO_OPERATION_CANCELLED</DefineConstants>
262+
<DefineConstants>$(DefineConstants);FX_NO_THREAD_STATIC</DefineConstants>
263+
264+
<AssemblySearchPaths>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)</AssemblySearchPaths>
265+
<OtherFlags>$(OtherFlags) --simpleresolution -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\mscorlib.dll" -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\System.dll" -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\$(TargetFrameworkProfile)\System.Core.dll"</OtherFlags>
266+
193267
</PropertyGroup>
194268

195269
<!-- Target Silverlight 3.0-->
@@ -365,12 +439,20 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
365439
<DefineConstants>$(DefineConstants);FX_NO_CONCURRENT_DICTIONARY</DefineConstants>
366440
<DefineConstants>$(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE;</DefineConstants>
367441
<DefineConstants>$(DefineConstants);FX_ATLEAST_LINQ</DefineConstants>
442+
443+
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
444+
<DefineConstants>$(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA</DefineConstants>
445+
<DefineConstants>$(DefineConstants);FX_NO_BIGINT</DefineConstants>
446+
<DefineConstants>$(DefineConstants);FX_NO_MONITOR_REPORTS_LOCKTAKEN</DefineConstants>
447+
<DefineConstants>$(DefineConstants);FX_NO_QUOTATIONS_COMPILE</DefineConstants>
448+
368449
<Tailcalls>false</Tailcalls>
369450
<SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
370451
<TargetFrameworkOutputDirectory>$(TargetFramework)</TargetFrameworkOutputDirectory>
371452
<!-- It would be better to use MSBuild resolution here, but the TargetFrameworkIdentifier etc. aren't set up quite correctly as yet-->
372-
<OtherFlags>$(OtherFlags) --simpleresolution -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\mscorlib.dll" </OtherFlags>
373-
</PropertyGroup>
453+
<AssemblySearchPaths>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone</AssemblySearchPaths>
454+
<OtherFlags>$(OtherFlags) --simpleresolution -r:"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\mscorlib.dll" </OtherFlags>
455+
</PropertyGroup>
374456

375457
<!-- Target CompactFramework 2.0-->
376458
<PropertyGroupCondition="'$(TargetFramework)'=='net20-cf'">
@@ -581,6 +663,8 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
581663
<!-- Include the portable targets file when building the portable FSharp.Core-->
582664
<ImportProject="$(MSBuildExtensionsPath32)\Microsoft\Portable\v4.0\Microsoft.Portable.Common.targets"
583665
Condition="'$(TargetFramework)'=='portable-net4+sl4+wp71+win8'"/>
666+
<ImportProject="$(MSBuildExtensionsPath32)\Microsoft\Portable\v4.0\Microsoft.Portable.Common.targets"
667+
Condition="'$(TargetFramework)'=='portable-net45+sl5+win8'"/>
584668

585669
<!-- Include the bootstrap targets file when building the proto compiler using the bootstrap-->
586670
<!-- Also include it if Proto targets file doesn't exist, e.g. when cleaning the build with /t:Clean-->
@@ -612,14 +696,15 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do
612696
Text="Configuration '$(Configuration)' is not one of the supported configurations: Debug, Release, Proto"
613697
Condition="'$(Configuration)'!='Release' and '$(Configuration)'!='Debug' and '$(Configuration)'!='Proto'"/>
614698
<Error
615-
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, mono21, wp7, sl5, sl5-compiler, portable-net4+sl4+wp71+win8"
699+
Text="TargetFramework '$(TargetFramework)' is not one of the supported configurations: 'empty', net20, net40, mono21, wp7, sl5, sl5-compiler, portable-net4+sl4+wp71+win8, portable-net45+sl5+win8"
616700
Condition="! ('$(TargetFramework)' == 'net40' or
617701
'$(TargetFramework)' == 'net20' or
618702
'$(TargetFramework)' == 'mono21' or
619703
'$(TargetFramework)' == 'sl5' or
620704
'$(TargetFramework)' == 'sl5-compiler' or
621705
'$(TargetFramework)' == 'wp7' or
622706
'$(TargetFramework)' == 'portable-net4+sl4+wp71+win8' or
707+
'$(TargetFramework)' == 'portable-net45+sl5+win8' or
623708
'$(TargetFramework)' == 'net40-xna40-xbox360')"/>
624709
</Target>
625710

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003"
2+
ToolsVersion="4.0">
3+
4+
<PropertyGroup>
5+
<TargetFramework>portable-net4+sl4+wp71+win8</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ImportProject="FSharp.Core.fsproj"/>
9+
10+
</Project>
11+

‎src/fsharp/FSharp.Core/FSharp.Core.fsproj‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@
212212
</CustomAdditionalCompileInputs>
213213
</ItemGroup>
214214
<ItemGroup>
215-
<ReferenceInclude="mscorlib" />
215+
<ReferenceInclude="mscorlib"Condition="'$(TargetFramework)' != 'wp7'"/>
216216
<ReferenceInclude="System" />
217217
<ReferenceInclude="System.Numerics"Condition="'$(TargetFramework)' == 'net40'" />
218-
<ReferenceInclude="System.Net"Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl5-compiler' OR '$(TargetFramework)' == 'XNA\5.0' OR '$(TargetFramework)' == 'wp7' OR '$(TargetFramework)' == 'portable-net4+sl4+wp71+win8' OR '$(TargetFramework)' == 'net40-xna40-xbox360'" />
218+
<ReferenceInclude="System.Net"Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl5-compiler' OR '$(TargetFramework)' == 'XNA\5.0' OR '$(TargetFramework)' == 'wp7' OR '$(TargetFramework)' == 'portable-net4+sl4+wp71+win8' OR '$(TargetFramework)' == 'portable-net45+sl5+win8' OR '$(TargetFramework)' == 'net40-xna40-xbox360'" />
219219
<ReferenceInclude="System.Observable"Condition="'$(TargetFramework)' == 'wp7'" />
220-
<ReferenceInclude="System.Core"Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl5-compiler' OR '$(TargetFramework)' == 'XNA\5.0' OR '$(TargetFramework)' == 'wp7' OR '$(TargetFramework)' == 'portable-net4+sl4+wp71+win8' OR '$(TargetFramework)' == 'net40-xna40-xbox360'" />
220+
<ReferenceInclude="System.Core"Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl5-compiler' OR '$(TargetFramework)' == 'XNA\5.0' OR '$(TargetFramework)' == 'wp7' OR '$(TargetFramework)' == 'portable-net4+sl4+wp71+win8' OR '$(TargetFramework)' == 'portable-net45+sl5+win8' OR '$(TargetFramework)' == 'net40-xna40-xbox360'" />
221221
</ItemGroup>
222222
<!-- References-->
223223
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />

‎src/fsharp/FSharp.Core/Linq.fs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,10 @@ module LeafExpressionConverter =
781781
// provides no other way to evaluate the expression.
782782
//
783783
// REVIEW: It is possible it is just better to interpret the expression in many common cases, e.g. property-gets, values etc.
784-
letEvaluateQuotation(e:Microsoft.FSharp.Quotations.Expr)=
784+
letEvaluateQuotation(e:Microsoft.FSharp.Quotations.Expr):obj=
785+
#if FX_NO_QUOTATIONS_COMPILE
786+
raise(new NotSupportedException())
787+
#else
785788
match ewith
786789
| Value(obj,_)-> obj
787790
|_->
@@ -793,7 +796,7 @@ module LeafExpressionConverter =
793796
d.DynamicInvoke[| box()|]
794797
with:? System.Reflection.TargetInvocationExceptionas exn->
795798
raise exn.InnerException
796-
799+
#endif
797800

798801
#endif
799-
802+

‎src/fsharp/FSharp.Core/control.fs‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,12 @@ namespace Microsoft.FSharp.Control
402402

403403
[<AllowNullLiteral>]
404404
typeTrampoline()=
405-
405+
406+
let mutablecont= None
407+
let mutablebindCount=0
408+
409+
static letunfake FakeUnit=()
410+
406411
[<Literal>]
407412
static letbindLimitBeforeHijack=300
408413
#if FX_NO_THREAD_STATIC
@@ -418,10 +423,6 @@ namespace Microsoft.FSharp.Control
418423
#else
419424
Trampoline.thisThreadHasTrampoline
420425
#endif
421-
let mutablecont= None
422-
let mutablebindCount=0
423-
424-
static letunfake FakeUnit=()
425426

426427
// Install a trampolineStack if none exists
427428
memberthis.ExecuteAction(firstAction:unit->FakeUnitValue)=
@@ -529,6 +530,7 @@ namespace Microsoft.FSharp.Control
529530
memberthis.Protect firstAction=
530531
trampoline<-new Trampoline()
531532
trampoline.ExecuteAction(firstAction)
533+
FakeUnit
532534

533535
memberthis.Trampoline= trampoline
534536

@@ -1495,11 +1497,21 @@ namespace Microsoft.FSharp.Control
14951497
Async.Start(async{do(ccont e|> unfake)})
14961498

14971499
// register cancellation handler
1498-
letregistration= aux.token.Register(fun()-> cancel(OperationCanceledException()))
1500+
letregistration= aux.token.Register((fun_-> cancel(OperationCanceledException())),null)
14991501

15001502
// run actual await routine
15011503
// callback will be executed on the thread pool so we need to use TrampolineHolder.Protect to install trampoline
15021504
try
1505+
#if FX_NO_TASK
1506+
ThreadPool.QueueUserWorkItem((fun _->
1507+
letasyncResult= WaitHandleIAsyncResult(waitHandle):> System.IAsyncResult
1508+
if asyncResult.IsCompletedthen
1509+
if latch.Enter()then
1510+
registration.Dispose()
1511+
aux.trampolineHolder.Protect(fun()-> sconttrue)
1512+
|> unfake
1513+
),null)|> ignore
1514+
#else
15031515
Task.Factory.FromAsync
15041516
(
15051517
WaitHandleIAsyncResult(waitHandle),
@@ -1510,6 +1522,7 @@ namespace Microsoft.FSharp.Control
15101522
|> unfake
15111523
)
15121524
|> ignore
1525+
#endif
15131526
// if user has specified timeout different from Timeout.Infinite
15141527
// then start another async to track timeout expiration
15151528
// StartWithContinuations already installs trampoline so we can invoke continuation directly

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp