Commit graph

29 commits

Author SHA1 Message Date
Jack251970
3d8fd1d352 Improve cancellation, locking, and logging mechanisms
Enhanced cancellation handling by adding `token.IsCancellationRequested` checks to improve responsiveness. Refactored locking mechanisms for `_win32sLock` and `_uwpsLock` using `try-finally` blocks to ensure proper acquisition and release, improving thread safety and preventing deadlocks.

Reorganized Win32 and UWP program querying logic for better modularity and readability. Replaced shared collection access with local variables to improve clarity and maintain thread safety. Simplified empty result handling by directly returning `emptyResults` when canceled.

Removed redundant debug log statements to reduce verbosity and updated remaining logs for clarity. Suppressed unused result warnings by replacing direct calls to `EverythingApiDllImport.Everything_GetMajorVersion()` with null-coalescing assignments.
2025-11-06 15:28:13 +08:00
Jack251970
db0c86d50c Remove CancellationToken from semaphore WaitAsync calls
Removed the `CancellationToken` parameter from `WaitAsync` calls
on semaphores in `EverythingAPI.cs` and `Main.cs`. This change
eliminates cancellation support for semaphore waits, likely due
to a design decision prioritizing simplicity or avoiding issues
with cancellation handling.

In `EverythingAPI.cs`, `WaitAsync(token)` was replaced with
`WaitAsync()` in two methods. Similarly, in `Main.cs`, the
`WaitAsync` calls for `_win32sLock` and `_uwpsLock` were updated
to remove the `token` parameter.

Note: This change may impact the ability to gracefully handle
cancellation during semaphore waits.
2025-11-04 14:25:55 +08:00
VictoriousRaptor
30f7ae0d67 Use Localization for Explorer plugin 2025-07-16 21:28:17 +08:00
Vic
00e6e5b30d Remove unused using 2023-04-25 21:02:34 +08:00
TheBestPessimist
1ed1c99931 Revert "add scoring based on index and small optimization"
This reverts commit 02b321c4a3.
2023-03-15 20:53:14 +02:00
Hongtao
02b321c4a3 add scoring based on index and small optimization 2023-03-14 16:42:09 -05:00
TheBestPessimist
48ed1fec15 more todo 2023-03-14 09:21:11 +02:00
TheBestPessimist
fa971c6b81 Ask Everything for RunCount only if sorting by it 2023-03-08 14:29:46 +02:00
TheBestPessimist
9bc6a4e072 Waiting on a semaphore must be outside of try 2023-03-08 14:29:46 +02:00
TheBestPessimist
84b63e5f54 Use Request Flags when retrieving results from Everything, to be able to retrieve RunCount as well 2023-03-08 14:29:46 +02:00
TheBestPessimist
ac3c955539 Async is hard.
Not sure exactly why the previous version was not working, but i _assume_ it's because I was in a deadlock on that semaphore.
2023-03-08 14:29:46 +02:00
TheBestPessimist
94b841d341 Should be working 2023-03-08 14:29:46 +02:00
TheBestPessimist
f96bf4c592 cleanup 2023-03-08 14:29:46 +02:00
TheBestPessimist
18d1bb5668 Cleanup unused properties 2023-01-26 09:19:42 +02:00
TheBestPessimist
1b9a879d48 Use EverythingSearchOption flag to set up FullPathSearch instead of hardcoding it 2023-01-26 08:58:41 +02:00
TheBestPessimist
2b6c92c48c question to the FL developers 2023-01-26 08:50:42 +02:00
TheBestPessimist
1482637cf1 Everything.MatchPath = true 2023-01-26 08:50:42 +02:00
Hongtao Zhang
e9d8579bbd
fix concurrency issue (really potentially) 2022-12-03 13:50:30 -06:00
Hongtao Zhang
4a0ee9b4fc
fix concurrency issue (potentially) 2022-12-03 13:44:43 -06:00
Hongtao Zhang
22bc292aa9
Add try catch to encounter dllnotfound issue and move warning string to resource 2022-11-28 21:38:27 -06:00
Hongtao Zhang
9267938018
Append Result for everything error and windows index error 2022-11-25 13:25:12 -06:00
Hongtao Zhang
2c3df3f4db
Change signature back to string to accommodate async method.
Port open Windows Context Menu feature
2022-09-24 14:23:59 -05:00
Hongtao Zhang
8b1c125bdf
Custom Exception & Some Refactor
- Try use ReadOnlySpan<char> instead of String for applicable API
- Use Customized Exception to return error result
2022-09-21 19:18:20 -05:00
Hongtao Zhang
000c45bfa8
Refactor Explorer Code to fit the new architecture
1. Rename some method in QueryConstructor.cs by removing prefix and suffix
2. Split the logic of checking '>' to outer SearchManager.cs
3. Use IAsyncEnumerable for potential future improvement.
2022-09-10 10:45:41 -05:00
Hongtao Zhang
a3622d472e
Code Refactor with IAsyncEnumerable instead of Task<IEnumerable> 2022-08-16 18:45:36 -04:00
Hongtao Zhang
9b471de3cf
Implement Path Enumeration and ContentSearch 2022-06-25 12:39:02 -05:00
Hongtao Zhang
fa0cd35e18
Support Path Enumeration (Part 1) 2022-06-25 12:39:02 -05:00
Hongtao Zhang
b671f562ef
Add missing File 2022-06-25 12:39:01 -05:00
Hongtao Zhang
6fdff2971c
Merge Explorer & Everything Plugins (Step 1)
1. Shared Interface for Windows Index and Everything Index
2. Settings Merge (Part 1)
3. Include Everything dll
2022-06-25 12:38:50 -05:00