Age | Commit message (Collapse) | Author | Files | Lines |
|
The compiler is now analyzing statics. Get compliant.
|
|
|
|
(#25214)
* Address nullable feedback for System.Threading.Overlapped
* Address nullable feedback for System.Memory
* Address nullable for System.Runtime.InteropServices
* Update xml comments and make CultureInfo nullable to match String.ToLower/Upper feedback
* PR feedback: revert accepting null comparer in BinarySearch
* Disable test that needs to be updated in corefx
|
|
|
|
* Add and apply nullable attributes
* Adapt to API review decisions
* Address PR feedback
|
|
respectively (master) (#24369)
* Update BuildTools, CoreClr to preview4-04022-01, preview6-27721-71, respectively
* Use `Nullable=enable` rather than `NullableContextOptions=enable`
* Resolving new nullability warnings
* PR Feedback
|
|
Rework use of marshalling for RuntimeTypeHandle, RuntimeModule, RuntimeAssembly, and IRuntimeMethodInfo as used by QCalls
- Remove special QCall only used marshallers for RuntimeAssembly, RuntimeModule and IRuntimeMethodInfo
- Following the pattern of ObjectHandleOnStack, implement QCall handle types for RuntimeAssembly/Module/TypeHandle. Use these in all QCalls that once passed the types directly.
- For uses of IRuntimeMethodInfo, follow the existing RuntimeMethodHandleInternal pattern
Also perform some replacement of bool marshalling with use of Interop.BOOL, and a few cases of using pointers instead of byref arguments.
Fix delivers a relatively small win on startup, and small throughput gains around reflection as IL stubs are no longer necessary for many functions in reflection that once needed them.
Reduces methods jitted on powershell startup from 422 to 399, (About 5%) but performance win is only about 5ms on ~400ms as the methods removed are simple.
|
|
Fix a contract violation in ThreadPool.get_CompletedWorkItemCount
Fixes https://github.com/dotnet/coreclr/issues/24515
- Looks like the path that acquires the thread store lock has code that is marked witH GC_TRIGGERS
- Changed ThreadPool.get_CompletedWorkItemCount and Monitor.get_LockContentionCount to use QCalls instead of FCalls
|
|
* Enable nullable at the project level
* Remove `#nullable enable` from individual files
Removes `#nullable enable` from almost all .cs files in System.Private.CoreLib. I left it only in the ~30 files (out of ~1480 that had it) that are mirrored to corefx, that are built into projects by corefx that don't yet set NullableContextOptions at the project level, and that use nullable annotations; otherwise, they'd break the corefx build.
|
|
System.Type, System.Reflection nullability
|
|
* Fix handling of negative numbers in ThreadPool.SetMin/MaxThreads
* Fix disabled test name
|
|
Implement APIs for some threading metrics (CoreCLR)
API review: https://github.com/dotnet/corefx/issues/35500
|
|
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it.
Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.
|
|
|
|
* Nullable: System.Threading.Tasks
* Address PR feedback
|
|
Finishes off annotation of the System.Threading namespace, not including subnamespaces.
|
|
Also fixing the class? annotation on public LazyInitializer methods.
|
|
* Nullable: Overlapped and friends
* Address PR feedback
|
|
|
|
|
|
|
|
|
|
* Move fully managed TimerQueue implementation to shared partition (#7111)
* Update CoreCLR for changes in shared partition
|
|
* Move more Thread logic to shared partition
* Keep the fields in runtime part for reliable layout structure
|
|
Add Serialization Guard API and consume it in CoreLib targets
|
|
To match existing behavior: https://github.com/dotnet/corefx/blob/5dc8132370532804a5381b90e2ce87d6c52b61f6/src/Common/src/CoreLib/System/Threading/Thread.Unix.cs#L13
|
|
* Fix GetApartmentState value on Unix to be Unknown
The code in corefx is returning ApartmentState.Unknown on Unix. This new coreclr implementation should do the same.
* Fix visibility on TrySetApartmentStateUnchecked
|
|
|
|
- Thread.ExecutionContext needs to return ExecutionContext.Capture() to public callers.
- Fix restoring of culture to be inside of the ExecutionContext callback where applicable
|
|
Its getter is a public API and can't be made internal.
|
|
* Move Thread to shared CoreLib
* Remove all local variables from Thread in shared code
* Remove duplicate checks
* Port back CoreRT changes needed for shared code
* Fix missing culture initialization in ThreadStart()
* Adjust for shared WaitHandle
|
|
* Move part of WaitHandle to shared CoreLib
* Bring back OpenExistingResult to fix build
* Move reminder of WaitHandle to shared, implement SynchronizationContext logic in managed code, handle SafeHandle referencing in managed code
* Update with changes neeeded for CoreRT
* Span -> ReadOnlySpan
* Remove dead code
* Fix SafeHandle error handling
* Avoid double check on input values in WaitHandle.WaitOne overloads
* Make OpenExistingResult private protected instead of internal
* Make WaitHandle._waitHandle private
* Code style fixes
* Remove unnecessary GC.KeepAlive
* Move ERROR_TOO_MANY_POSTS exception handling to CoreCLR specific code
* Add cache for wait arrays to match previous CoreRT behavior and reduce GC pressure, change unmanaged code to allocate small array on stack
* Address PR feedback
* Reduce allocations/copying by moving stack allocation to managed code
* Address PR feedback
* Minor code reshuffle
* Move thread local access close to each other
* Address code style feedback
* Add const to Wait* constants
|
|
* Remove unnecessary fields from WaitHandle
* Drop volatile from _waitHandle
* Address race condition in unmanaged code
* Remove unused hasThreadAffinity parameters
* Fix FCDECL argument counts
|
|
* Replace Win32Native.cs with Interop files
- Replace Win32Native usage with existing Interop.* calls where they already existed
- Moved Win32Native.* to their own files otherwise, and changed call sites
- Left a stub Win32Native in place to handle some emitted IL from the runtime. The current infrastructure doesn't support targeting nested types, like Interop.Kernel32, and fixing that would be more involved.
* Remove Win32Native.cs
Replace emitted calls with ones to Marshal.
* Fix incorrectly changed field
* Fix Kernel32 -> Ole32
|
|
* Move Volatile to shared
This largely takes corert's implementation, which uses Unsafe.As and volatile fields.
We could investigate also removing the JIT's replacements subsequently.
* Add [Intrinsic] attributes
|
|
* Move SynchronizationContext to shared partition
* Move WaitHelperNative to WaitHandle
|
|
* Move Timer to shared CoreLib partition.
* Move SignalNoCallbacksRunning back to shared code, add static EventWaitHandle.Set.
* Remove AppDomain references from shared Timer code, reshuffle some code out of SetTimer in non-shared code.
* Change m_ prefix to match code style.
|
|
* Rename TplEtwProvider to TplEventSource
* Rename etwLog to log
|
|
* Move TaskContinuation to shared partition
* Remove TASK_STATE_THREAD_WAS_ABORTED from Task
* Use already existing ThrowAsync
|
|
|
|
And disable several NoWarns.
|
|
* Move common ThreadPool code to shared CoreLib partition.
* Move numWorkingThreads counting out of shared code.
* Rename ThreadPoolGlobals.vmTpInitialized to threadPoolInitialized.
Remove exception handling from ThreadPoolWorkQueue.Dispatch.
Remove obsolete code from ThreadPoolWorkQueue.Dispatch.
Rename ThreadPool.EnsureVMInitialized to ThreadPool.EnsureInitialized.
|
|
|
|
|
|
|
|
|
|
* Move AsyncCausality to shared partition
* Set FeatureAsyncCausalityTracer property
|
|
When a TaskCompletionSource is constructed without any arguments, it simply creates a Task using a simple Task constructor that sets a few fields and is done. When it's constructed with options, though, those options are validated, and then it calls into a shared routine that configures based on those options. A previous set of changes resulted in erroneously doing the ExecutionContext.Capture for the task inside of that shared routine, rather than only doing it for tasks that actually have a delegate to be executed. The net effect of this is that, while TaskCompletionSources created with the parameterless constructor correctly did not capture ExecutionContext, TaskCompletionSources created with options erroneously did; this doesn't have a functional impact, because that ExecutionContext isn't used for anything, but it can have a performance impact, in particular for memory, if the resulting Task is cached, and if the captured ExecutionContext holds onto some expensive object from an AsyncLocal, such that the cached Task then does so, too.
The fix is simply to move the capture from the shared routine that's invoked in two places to instead be done only in the one caller that's for tasks with delegates.
|
|
* Use pattern matching `is` rather than `as` with null check
|
|
|