Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awake Updates - PROMETHEAN_09082024 #34717

Merged
merged 18 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pipelines/v2/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ parameters:
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: true
default: false
- name: runTests
type: boolean
displayName: "Run Tests"
Expand Down
23 changes: 16 additions & 7 deletions doc/planning/awake.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ The build ID can be found in `Core\Constants.cs` in the `BuildId` variable - it

The build ID moniker is made up of two components - a reference to a [Halo](https://en.wikipedia.org/wiki/Halo_(franchise)) character, and the date when the work on the specific build started in the format of `MMDDYYYY`.

| Build ID | Build Date |
|:-------------------------------------------------------------------|:----------------|
| [`VISEGRADRELAY_08152024`](#VISEGRADRELAY_08152024-august-15-2024) | August 15, 2024 |
| [`DAISY023_04102024`](#DAISY023_04102024-april-10-2024) | April 10, 2024 |
| [`ATRIOX_04132023`](#ATRIOX_04132023-april-13-2023) | April 13, 2023 |
| [`LIBRARIAN_03202022`](#librarian_03202022-march-20-2022) | March 20, 2022 |
| `ARBITER_01312022` | January 31, 2022 |
| Build ID | Build Date |
|:-------------------------------------------------------------------|:------------------|
| [`PROMETHEAN_09082024`](#PROMETHEAN_09082024-september-8-2024) | September 8, 2024 |
| [`VISEGRADRELAY_08152024`](#VISEGRADRELAY_08152024-august-15-2024) | August 15, 2024 |
| [`DAISY023_04102024`](#DAISY023_04102024-april-10-2024) | April 10, 2024 |
| [`ATRIOX_04132023`](#ATRIOX_04132023-april-13-2023) | April 13, 2023 |
| [`LIBRARIAN_03202022`](#librarian_03202022-march-20-2022) | March 20, 2022 |
| `ARBITER_01312022` | January 31, 2022 |

### `PROMETHEAN_09082024` (September 8, 2024)

>[!NOTE]
>See pull request: [Awake - `PROMETHEAN_09082024`](https://github.com/microsoft/PowerToys/pull/34717)

- Updating the initialization logic to make sure that settings are respected for proper group policy and single-instance detection.
- [#34148] Fixed a bug from the previous release that incorrectly synchronized threads for shell icon creation and initialized parent PID when it was not parented.

### `VISEGRADRELAY_08152024` (August 15, 2024)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/awake/Awake/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ internal static class Constants
// Format of the build ID is: CODENAME_MMDDYYYY, where MMDDYYYY
// is representative of the date when the last change was made before
// the pull request is issued.
internal const string BuildId = "VISEGRADRELAY_08152024";
internal const string BuildId = "PROMETHEAN_09082024";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
using System.Collections.Generic;
using System.Threading;

namespace Awake.Core.Models
namespace Awake.Core.Threading
{
internal sealed class SingleThreadSynchronizationContext : SynchronizationContext
{
private readonly Queue<Tuple<SendOrPostCallback, object>> queue =
new();
private readonly Queue<Tuple<SendOrPostCallback, object?>?> queue = new();

#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
public override void Post(SendOrPostCallback d, object state)
#pragma warning restore CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
public override void Post(SendOrPostCallback d, object? state)
{
ArgumentNullException.ThrowIfNull(d);

lock (queue)
{
queue.Enqueue(Tuple.Create(d, state));
Expand All @@ -28,7 +27,7 @@ public void BeginMessageLoop()
{
while (true)
{
Tuple<SendOrPostCallback, object> work;
Tuple<SendOrPostCallback, object?>? work;
lock (queue)
{
while (queue.Count == 0)
Expand All @@ -44,17 +43,22 @@ public void BeginMessageLoop()
break;
}

work.Item1(work.Item2);
try
{
work.Item1(work.Item2);
}
catch (Exception e)
{
Console.WriteLine("Error during execution: " + e.Message);
}
}
}

public void EndMessageLoop()
{
lock (queue)
{
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
queue.Enqueue(null); // Signal the end of the message loop
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
Monitor.Pulse(queue);
}
}
Expand Down
Loading
Loading