• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemoBytom / DemoEngine / 24940020806

25 Apr 2026 08:30PM UTC coverage: 28.251% (-1.5%) from 29.75%
24940020806

push

coveralls.net

DemoBytom
Remove old `StaThreadService` and related codebase

Superseeded by `WindowsMessagePump`

1208 of 4276 relevant lines covered (28.25%)

0.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Demo.Engine.Core/Features/StaThread/StaThreadWriter.cs
1
// Copyright © Michał Dembski and contributors.
2
// Distributed under MIT license. See LICENSE file in the root for more information.
3

4
using System.Threading.Channels;
5
using Demo.Engine.Core.Interfaces.Rendering;
6
using Demo.Engine.Core.ValueObjects;
7

8
namespace Demo.Engine.Core.Features.StaThread;
9

10
internal sealed class StaThreadWriter(
×
11
    ChannelWriter<StaThreadRequests> channelWriter)
×
12
    : IStaThreadWriter,
13
      IDisposable
14
{
15
    private readonly ChannelWriter<StaThreadRequests> _channelWriter = channelWriter;
×
16
    private bool _disposedValue;
17

18
    public async Task<RenderingSurfaceId> CreateSurface(
19
        IRenderingEngine renderingEngine,
20
        CancellationToken cancellationToken = default)
21
    {
22
        var createSurfaceRequest = StaThreadRequests.CreateSurface(renderingEngine);
×
23
        await _channelWriter.WriteAsync(
×
24
                createSurfaceRequest,
×
25
                cancellationToken);
×
26

27
        return await createSurfaceRequest.Invoked;
×
28
    }
×
29

30
    private void Dispose(bool disposing)
31
    {
32
        if (!_disposedValue)
×
33
        {
34
            if (disposing)
×
35
            {
36
                _channelWriter.Complete();
×
37
            }
38

39
            _disposedValue = true;
×
40
        }
41
    }
×
42

43
    public void Dispose()
44
    {
45
        // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
46
        Dispose(disposing: true);
×
47
        GC.SuppressFinalize(this);
×
48
    }
×
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc