react-native-windows 0.67.5 → 0.67.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +138 -0
- package/CHANGELOG.md +60 -4
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +37 -3
- package/Mso/dispatchQueue/dispatchQueue.h +6 -1
- package/Mso/src/dispatchQueue/threadPoolScheduler_win.cpp +96 -4
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,144 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Mon, 25 Apr 2022 15:11:22 GMT",
|
|
6
|
+
"tag": "react-native-windows_v0.67.8",
|
|
7
|
+
"version": "0.67.8",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "vmorozov@microsoft.com",
|
|
12
|
+
"package": "react-native-windows",
|
|
13
|
+
"commit": "d317482299129e89a8bdf57a8ccefe6238e0a541",
|
|
14
|
+
"comment": "Fix Sequential DispatchQueue deadlock on shutdown"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 04 Apr 2022 15:13:28 GMT",
|
|
21
|
+
"tag": "react-native-windows_v0.67.7",
|
|
22
|
+
"version": "0.67.7",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "asklar@microsoft.com",
|
|
27
|
+
"package": "react-native-windows",
|
|
28
|
+
"commit": "not available",
|
|
29
|
+
"comment": "MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9609)"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "34109996+chiaramooney@users.noreply.github.com",
|
|
33
|
+
"package": "react-native-windows",
|
|
34
|
+
"commit": "not available",
|
|
35
|
+
"comment": "Promote 0.67 to legacy"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "react-native-windows",
|
|
40
|
+
"comment": "Bump @react-native-windows/cli to v0.67.2",
|
|
41
|
+
"commit": "4d4f19bef79e0fb2f6198b18c9e77d0da98a6938"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "react-native-windows",
|
|
46
|
+
"comment": "Bump @react-native-windows/virtualized-list to v0.67.1",
|
|
47
|
+
"commit": "4d4f19bef79e0fb2f6198b18c9e77d0da98a6938"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "react-native-windows",
|
|
52
|
+
"comment": "Bump @react-native-windows/codegen to v0.67.1",
|
|
53
|
+
"commit": "4d4f19bef79e0fb2f6198b18c9e77d0da98a6938"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Mon, 04 Apr 2022 15:12:55 GMT",
|
|
60
|
+
"tag": "react-native-windows_v0.67.7",
|
|
61
|
+
"version": "0.67.7",
|
|
62
|
+
"comments": {
|
|
63
|
+
"patch": [
|
|
64
|
+
{
|
|
65
|
+
"author": "asklar@microsoft.com",
|
|
66
|
+
"package": "react-native-windows",
|
|
67
|
+
"commit": "e92602643cb768e9ce34430e9800d76769a31a2a",
|
|
68
|
+
"comment": "MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9609)"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "34109996+chiaramooney@users.noreply.github.com",
|
|
72
|
+
"package": "react-native-windows",
|
|
73
|
+
"commit": "f4f970be35618e9942c5c96e6c15c88f8426c91c",
|
|
74
|
+
"comment": "Promote 0.67 to legacy"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "react-native-windows",
|
|
79
|
+
"comment": "Bump @react-native-windows/cli to v0.67.2",
|
|
80
|
+
"commit": "e92602643cb768e9ce34430e9800d76769a31a2a"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"author": "beachball",
|
|
84
|
+
"package": "react-native-windows",
|
|
85
|
+
"comment": "Bump @react-native-windows/virtualized-list to v0.67.1",
|
|
86
|
+
"commit": "e92602643cb768e9ce34430e9800d76769a31a2a"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"author": "beachball",
|
|
90
|
+
"package": "react-native-windows",
|
|
91
|
+
"comment": "Bump @react-native-windows/codegen to v0.67.1",
|
|
92
|
+
"commit": "e92602643cb768e9ce34430e9800d76769a31a2a"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"date": "Tue, 29 Mar 2022 17:35:30 GMT",
|
|
99
|
+
"tag": "react-native-windows_v0.67.6",
|
|
100
|
+
"version": "0.67.6",
|
|
101
|
+
"comments": {
|
|
102
|
+
"patch": [
|
|
103
|
+
{
|
|
104
|
+
"author": "asklar@microsoft.com",
|
|
105
|
+
"package": "react-native-windows",
|
|
106
|
+
"commit": "not available",
|
|
107
|
+
"comment": "Guard against crashes due to cancelations and other errors from BitmapSource/SvgImageSource SetSourceAsync"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"date": "Tue, 29 Mar 2022 17:35:16 GMT",
|
|
114
|
+
"tag": "react-native-windows_v0.67.6",
|
|
115
|
+
"version": "0.67.6",
|
|
116
|
+
"comments": {
|
|
117
|
+
"patch": [
|
|
118
|
+
{
|
|
119
|
+
"author": "asklar@microsoft.com",
|
|
120
|
+
"package": "react-native-windows",
|
|
121
|
+
"commit": "cca2db0ac45b646f7a157a34564e221846eaf55b",
|
|
122
|
+
"comment": "Guard against crashes due to cancelations and other errors from BitmapSource/SvgImageSource SetSourceAsync"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"date": "Mon, 21 Mar 2022 15:13:26 GMT",
|
|
129
|
+
"tag": "react-native-windows_v0.67.5",
|
|
130
|
+
"version": "0.67.5",
|
|
131
|
+
"comments": {
|
|
132
|
+
"patch": [
|
|
133
|
+
{
|
|
134
|
+
"author": "asklar@microsoft.com",
|
|
135
|
+
"package": "react-native-windows",
|
|
136
|
+
"commit": "not available",
|
|
137
|
+
"comment": "move some DLLs to delayload"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
4
142
|
{
|
|
5
143
|
"date": "Mon, 21 Mar 2022 15:13:12 GMT",
|
|
6
144
|
"tag": "react-native-windows_v0.67.5",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,73 @@
|
|
|
1
1
|
# Change Log - react-native-windows
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 25 Apr 2022 15:11:22 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.67.
|
|
7
|
+
## 0.67.8
|
|
8
8
|
|
|
9
|
-
Mon,
|
|
9
|
+
Mon, 25 Apr 2022 15:11:22 GMT
|
|
10
10
|
|
|
11
11
|
### Patches
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- Fix Sequential DispatchQueue deadlock on shutdown (vmorozov@microsoft.com)
|
|
14
14
|
|
|
15
|
+
## 0.67.7
|
|
16
|
+
|
|
17
|
+
Mon, 04 Apr 2022 15:13:28 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9609) (asklar@microsoft.com)
|
|
22
|
+
- Promote 0.67 to legacy (34109996+chiaramooney@users.noreply.github.com)
|
|
23
|
+
- Bump @react-native-windows/cli to v0.67.2
|
|
24
|
+
- Bump @react-native-windows/virtualized-list to v0.67.1
|
|
25
|
+
- Bump @react-native-windows/codegen to v0.67.1
|
|
26
|
+
|
|
27
|
+
## 0.67.7
|
|
28
|
+
|
|
29
|
+
Mon, 04 Apr 2022 15:12:55 GMT
|
|
30
|
+
|
|
31
|
+
### Patches
|
|
32
|
+
|
|
33
|
+
- MustBeNoExceptVoidFunctor should depend on the template type parameter to avoid being evaluated too early (#9609) (asklar@microsoft.com)
|
|
34
|
+
- Promote 0.67 to legacy (34109996+chiaramooney@users.noreply.github.com)
|
|
35
|
+
- Bump @react-native-windows/cli to v0.67.2
|
|
36
|
+
- Bump @react-native-windows/virtualized-list to v0.67.1
|
|
37
|
+
- Bump @react-native-windows/codegen to v0.67.1
|
|
38
|
+
|
|
39
|
+
## 0.67.6
|
|
40
|
+
|
|
41
|
+
Tue, 29 Mar 2022 17:35:30 GMT
|
|
42
|
+
|
|
43
|
+
### Patches
|
|
44
|
+
|
|
45
|
+
- Guard against crashes due to cancelations and other errors from BitmapSource/SvgImageSource SetSourceAsync (asklar@microsoft.com)
|
|
46
|
+
|
|
47
|
+
## 0.67.6
|
|
48
|
+
|
|
49
|
+
Tue, 29 Mar 2022 17:35:16 GMT
|
|
50
|
+
|
|
51
|
+
### Patches
|
|
52
|
+
|
|
53
|
+
- Guard against crashes due to cancelations and other errors from BitmapSource/SvgImageSource SetSourceAsync (asklar@microsoft.com)
|
|
54
|
+
|
|
55
|
+
## 0.67.5
|
|
56
|
+
|
|
57
|
+
Mon, 21 Mar 2022 15:13:26 GMT
|
|
58
|
+
|
|
59
|
+
### Patches
|
|
60
|
+
|
|
61
|
+
- move some DLLs to delayload (asklar@microsoft.com)
|
|
62
|
+
|
|
63
|
+
## 0.67.5
|
|
64
|
+
|
|
65
|
+
Mon, 21 Mar 2022 15:13:12 GMT
|
|
66
|
+
|
|
67
|
+
### Patches
|
|
68
|
+
|
|
69
|
+
- move some DLLs to delayload (asklar@microsoft.com)
|
|
70
|
+
|
|
15
71
|
## 0.67.4
|
|
16
72
|
|
|
17
73
|
Mon, 14 Mar 2022 15:14:00 GMT
|
|
@@ -184,7 +184,7 @@ winrt::IAsyncOperation<winrt::InMemoryRandomAccessStream> ReactImage::GetImageMe
|
|
|
184
184
|
}
|
|
185
185
|
template <typename TImage>
|
|
186
186
|
std::wstring GetUriFromImage(const TImage &image) {
|
|
187
|
-
return image.UriSource().ToString().c_str();
|
|
187
|
+
return image.UriSource() ? image.UriSource().ToString().c_str() : L"<no Uri available>";
|
|
188
188
|
}
|
|
189
189
|
template <>
|
|
190
190
|
std::wstring GetUriFromImage(const winrt::Uri &uri) {
|
|
@@ -193,7 +193,9 @@ std::wstring GetUriFromImage(const winrt::Uri &uri) {
|
|
|
193
193
|
|
|
194
194
|
template <typename TImage>
|
|
195
195
|
void ImageFailed(const TImage &image, const xaml::ExceptionRoutedEventArgs &args) {
|
|
196
|
+
#ifdef DEBUG
|
|
196
197
|
cdebug << L"Failed to load image " << GetUriFromImage(image) << L" (" << args.ErrorMessage().c_str() << L")\n";
|
|
198
|
+
#endif
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
// TSourceFailedEventArgs can be either LoadedImageSourceLoadCompletedEventArgs or
|
|
@@ -203,10 +205,12 @@ void ImageFailed(const TImage &image, const xaml::ExceptionRoutedEventArgs &args
|
|
|
203
205
|
template <typename TImage, typename TSourceFailedEventArgs>
|
|
204
206
|
void ImageFailed(const TImage &image, const TSourceFailedEventArgs &args) {
|
|
205
207
|
// https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.loadedimagesourceloadstatus
|
|
208
|
+
#ifdef DEBUG
|
|
206
209
|
constexpr std::wstring_view statusNames[] = {L"Success", L"NetworkError", L"InvalidFormat", L"Other"};
|
|
207
210
|
const auto status = (int)args.Status();
|
|
208
211
|
assert(0 <= status && status < ARRAYSIZE(statusNames));
|
|
209
212
|
cdebug << L"Failed to load image " << GetUriFromImage(image) << L" (" << statusNames[status] << L")\n";
|
|
213
|
+
#endif
|
|
210
214
|
}
|
|
211
215
|
|
|
212
216
|
winrt::fire_and_forget ReactImage::SetBackground(bool fireLoadEndEvent) {
|
|
@@ -342,7 +346,22 @@ winrt::fire_and_forget ReactImage::SetBackground(bool fireLoadEndEvent) {
|
|
|
342
346
|
}
|
|
343
347
|
|
|
344
348
|
if (fromStream) {
|
|
345
|
-
|
|
349
|
+
try {
|
|
350
|
+
co_await svgImageSource.SetSourceAsync(memoryStream);
|
|
351
|
+
} catch (const winrt::hresult_error &) {
|
|
352
|
+
/*
|
|
353
|
+
winrt::hresult_canceled
|
|
354
|
+
If the app changes the image source again via SetSourceAsync, SetSource or UriSource while a
|
|
355
|
+
SetSourceAsync call is already in progress, the pending SetSourceAsync action will throw a
|
|
356
|
+
TaskCanceledException and set the Status to Canceled.
|
|
357
|
+
|
|
358
|
+
WINCODEC_ERR_BADIMAGE
|
|
359
|
+
In low memory situations (most likely on lower-memory phones), it is possible for an exception to be
|
|
360
|
+
raised with the message "The image is unrecognized" and an HRESULT of 0x88982F60. While this exception
|
|
361
|
+
ordinarily indicates bad data, if your app is close to its memory limit then the cause of the exception
|
|
362
|
+
is likely to be low memory. In that case, we recommend that you free memory and try again.
|
|
363
|
+
*/
|
|
364
|
+
}
|
|
346
365
|
} else {
|
|
347
366
|
svgImageSource.UriSource(uri);
|
|
348
367
|
}
|
|
@@ -385,7 +404,22 @@ winrt::fire_and_forget ReactImage::SetBackground(bool fireLoadEndEvent) {
|
|
|
385
404
|
}
|
|
386
405
|
|
|
387
406
|
if (fromStream) {
|
|
388
|
-
|
|
407
|
+
try {
|
|
408
|
+
co_await bitmapImage.SetSourceAsync(memoryStream);
|
|
409
|
+
} catch (const winrt::hresult_error &) {
|
|
410
|
+
/*
|
|
411
|
+
winrt::hresult_canceled
|
|
412
|
+
If the app changes the image source again via SetSourceAsync, SetSource or UriSource while a
|
|
413
|
+
SetSourceAsync call is already in progress, the pending SetSourceAsync action will throw a
|
|
414
|
+
TaskCanceledException and set the Status to Canceled.
|
|
415
|
+
|
|
416
|
+
WINCODEC_ERR_BADIMAGE
|
|
417
|
+
In low memory situations (most likely on lower-memory phones), it is possible for an exception to be
|
|
418
|
+
raised with the message "The image is unrecognized" and an HRESULT of 0x88982F60. While this exception
|
|
419
|
+
ordinarily indicates bad data, if your app is close to its memory limit then the cause of the exception
|
|
420
|
+
is likely to be low memory. In that case, we recommend that you free memory and try again.
|
|
421
|
+
*/
|
|
422
|
+
}
|
|
389
423
|
} else {
|
|
390
424
|
bitmapImage.UriSource(uri);
|
|
391
425
|
|
|
@@ -723,9 +723,14 @@ inline DispatchTaskImpl<TInvoke, TOnCancel>::~DispatchTaskImpl() noexcept {
|
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
+
namespace details {
|
|
727
|
+
template <typename>
|
|
728
|
+
constexpr bool always_false = false;
|
|
729
|
+
}
|
|
730
|
+
|
|
726
731
|
template <typename T>
|
|
727
732
|
inline void MustBeNoExceptVoidFunctor() {
|
|
728
|
-
static_assert(
|
|
733
|
+
static_assert(details::always_false<T>, __FUNCTION__ ": not a noexcept callable functor returning void");
|
|
729
734
|
}
|
|
730
735
|
|
|
731
736
|
template <typename TInvoke, typename TOnCancel>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
|
|
4
|
+
#include <utility>
|
|
4
5
|
#include "dispatchQueue/dispatchQueue.h"
|
|
5
6
|
#include "queueService.h"
|
|
6
7
|
|
|
@@ -29,6 +30,13 @@ struct ThreadPoolSchedulerWin : Mso::UnknownObject<IDispatchQueueScheduler> {
|
|
|
29
30
|
void Shutdown() noexcept override;
|
|
30
31
|
void AwaitTermination() noexcept override;
|
|
31
32
|
|
|
33
|
+
public: // Used by test APIs
|
|
34
|
+
static void EnableThreadPoolWorkTracking(bool enable) noexcept;
|
|
35
|
+
static void WaitForThreadPoolWorkCompletion() noexcept;
|
|
36
|
+
|
|
37
|
+
private: // Used by test APIs
|
|
38
|
+
static void TrackThreadPoolWork(const std::shared_ptr<TP_WORK> &work) noexcept;
|
|
39
|
+
|
|
32
40
|
private:
|
|
33
41
|
struct ThreadAccessGuard {
|
|
34
42
|
ThreadAccessGuard(ThreadPoolSchedulerWin *scheduler) noexcept;
|
|
@@ -42,12 +50,29 @@ struct ThreadPoolSchedulerWin : Mso::UnknownObject<IDispatchQueueScheduler> {
|
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
private:
|
|
45
|
-
std::
|
|
53
|
+
std::shared_ptr<TP_WORK> m_threadPoolWork;
|
|
46
54
|
Mso::WeakPtr<IDispatchQueueService> m_queue;
|
|
47
55
|
const uint32_t m_maxThreads{1};
|
|
48
56
|
std::atomic<uint32_t> m_usedThreads{0};
|
|
49
57
|
|
|
50
58
|
constexpr static uint32_t MaxConcurrentThreads{64};
|
|
59
|
+
|
|
60
|
+
private:
|
|
61
|
+
static std::mutex s_threadPoolWorkMutex;
|
|
62
|
+
static bool s_enableThreadPoolWorkTracking;
|
|
63
|
+
static std::vector<std::shared_ptr<TP_WORK>> s_trackedThreadPoolWork;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Track the ThreadPoolSchedulerWin instance used by current thread.
|
|
67
|
+
// We use it to avoid a deadlock on queue shutdown.
|
|
68
|
+
struct ThreadPoolSchedulerWinContext {
|
|
69
|
+
ThreadPoolSchedulerWinContext(ThreadPoolSchedulerWin *scheduler) noexcept;
|
|
70
|
+
~ThreadPoolSchedulerWinContext() noexcept;
|
|
71
|
+
static ThreadPoolSchedulerWin *CurrentScheduler() noexcept;
|
|
72
|
+
|
|
73
|
+
private:
|
|
74
|
+
static thread_local ThreadPoolSchedulerWin *tls_scheduler;
|
|
75
|
+
ThreadPoolSchedulerWin *m_prevScheduler{nullptr};
|
|
51
76
|
};
|
|
52
77
|
|
|
53
78
|
//=============================================================================
|
|
@@ -64,9 +89,15 @@ void ThreadPoolWorkDeleter::operator()(TP_WORK *tpWork) noexcept {
|
|
|
64
89
|
// ThreadPoolSchedulerWin implementation
|
|
65
90
|
//=============================================================================
|
|
66
91
|
|
|
92
|
+
std::mutex ThreadPoolSchedulerWin::s_threadPoolWorkMutex;
|
|
93
|
+
bool ThreadPoolSchedulerWin::s_enableThreadPoolWorkTracking{false};
|
|
94
|
+
std::vector<std::shared_ptr<TP_WORK>> ThreadPoolSchedulerWin::s_trackedThreadPoolWork;
|
|
95
|
+
|
|
67
96
|
ThreadPoolSchedulerWin::ThreadPoolSchedulerWin(uint32_t maxThreads) noexcept
|
|
68
|
-
: m_threadPoolWork{::CreateThreadpoolWork(WorkCallback, this, nullptr)},
|
|
69
|
-
m_maxThreads{maxThreads == 0 ? MaxConcurrentThreads : maxThreads} {
|
|
97
|
+
: m_threadPoolWork{::CreateThreadpoolWork(WorkCallback, this, nullptr), ThreadPoolWorkDeleter{}},
|
|
98
|
+
m_maxThreads{maxThreads == 0 ? MaxConcurrentThreads : maxThreads} {
|
|
99
|
+
TrackThreadPoolWork(m_threadPoolWork);
|
|
100
|
+
}
|
|
70
101
|
|
|
71
102
|
ThreadPoolSchedulerWin::~ThreadPoolSchedulerWin() noexcept {
|
|
72
103
|
AwaitTermination();
|
|
@@ -78,6 +109,7 @@ ThreadPoolSchedulerWin::~ThreadPoolSchedulerWin() noexcept {
|
|
|
78
109
|
_Inout_ PTP_WORK /*work*/) {
|
|
79
110
|
// The ThreadPoolSchedulerWin is alive here because m_threadPoolWork must be completed before it is destroyed.
|
|
80
111
|
ThreadPoolSchedulerWin *self = static_cast<ThreadPoolSchedulerWin *>(context);
|
|
112
|
+
ThreadPoolSchedulerWinContext schedulerContext(self);
|
|
81
113
|
|
|
82
114
|
if (auto queue = self->m_queue.GetStrongPtr()) {
|
|
83
115
|
auto endTime = std::chrono::steady_clock::now() + 100ms;
|
|
@@ -129,7 +161,38 @@ void ThreadPoolSchedulerWin::Shutdown() noexcept {
|
|
|
129
161
|
}
|
|
130
162
|
|
|
131
163
|
void ThreadPoolSchedulerWin::AwaitTermination() noexcept {
|
|
132
|
-
|
|
164
|
+
// Avoid deadlock when the dispatch queue and ThreadPoolSchedulerWin are released from inside of a task.
|
|
165
|
+
if (ThreadPoolSchedulerWinContext::CurrentScheduler() != this) {
|
|
166
|
+
::WaitForThreadpoolWorkCallbacks(m_threadPoolWork.get(), false);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
void ThreadPoolSchedulerWin::EnableThreadPoolWorkTracking(bool enable) noexcept {
|
|
171
|
+
std::vector<std::shared_ptr<TP_WORK>> tpWorkToStopTracking;
|
|
172
|
+
{
|
|
173
|
+
std::scoped_lock lock{s_threadPoolWorkMutex};
|
|
174
|
+
s_enableThreadPoolWorkTracking = enable;
|
|
175
|
+
// Reset all previously tracked work
|
|
176
|
+
tpWorkToStopTracking = std::move(s_trackedThreadPoolWork);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
void ThreadPoolSchedulerWin::WaitForThreadPoolWorkCompletion() noexcept {
|
|
181
|
+
std::vector<std::shared_ptr<TP_WORK>> tpWorkToTrack;
|
|
182
|
+
{
|
|
183
|
+
std::scoped_lock lock{s_threadPoolWorkMutex};
|
|
184
|
+
tpWorkToTrack = std::move(s_trackedThreadPoolWork);
|
|
185
|
+
}
|
|
186
|
+
for (std::shared_ptr<TP_WORK> &tpWork : tpWorkToTrack) {
|
|
187
|
+
::WaitForThreadpoolWorkCallbacks(tpWork.get(), false);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
void ThreadPoolSchedulerWin::TrackThreadPoolWork(const std::shared_ptr<TP_WORK> &tpWork) noexcept {
|
|
192
|
+
std::scoped_lock lock{s_threadPoolWorkMutex};
|
|
193
|
+
if (s_enableThreadPoolWorkTracking) {
|
|
194
|
+
s_trackedThreadPoolWork.push_back(tpWork);
|
|
195
|
+
}
|
|
133
196
|
}
|
|
134
197
|
|
|
135
198
|
//=============================================================================
|
|
@@ -151,6 +214,23 @@ ThreadPoolSchedulerWin::ThreadAccessGuard::~ThreadAccessGuard() noexcept {
|
|
|
151
214
|
return tls_scheduler == scheduler;
|
|
152
215
|
}
|
|
153
216
|
|
|
217
|
+
//=============================================================================
|
|
218
|
+
// ThreadPoolSchedulerWinContext implementation
|
|
219
|
+
//=============================================================================
|
|
220
|
+
|
|
221
|
+
thread_local ThreadPoolSchedulerWin *ThreadPoolSchedulerWinContext::tls_scheduler{nullptr};
|
|
222
|
+
|
|
223
|
+
ThreadPoolSchedulerWinContext::ThreadPoolSchedulerWinContext(ThreadPoolSchedulerWin *scheduler) noexcept
|
|
224
|
+
: m_prevScheduler(std::exchange(tls_scheduler, scheduler)) {}
|
|
225
|
+
|
|
226
|
+
ThreadPoolSchedulerWinContext::~ThreadPoolSchedulerWinContext() noexcept {
|
|
227
|
+
std::exchange(tls_scheduler, m_prevScheduler);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
ThreadPoolSchedulerWin *ThreadPoolSchedulerWinContext::CurrentScheduler() noexcept {
|
|
231
|
+
return tls_scheduler;
|
|
232
|
+
}
|
|
233
|
+
|
|
154
234
|
//=============================================================================
|
|
155
235
|
// DispatchQueueStatic::MakeThreadPoolScheduler implementation
|
|
156
236
|
//=============================================================================
|
|
@@ -160,4 +240,16 @@ ThreadPoolSchedulerWin::ThreadAccessGuard::~ThreadAccessGuard() noexcept {
|
|
|
160
240
|
return Mso::Make<ThreadPoolSchedulerWin, IDispatchQueueScheduler>(maxThreads);
|
|
161
241
|
}
|
|
162
242
|
|
|
243
|
+
//=============================================================================
|
|
244
|
+
// Test specific functions
|
|
245
|
+
//=============================================================================
|
|
246
|
+
|
|
247
|
+
void Test_ThreadPoolSchedulerWin_EnableThreadPoolWorkTracking(bool enable) noexcept {
|
|
248
|
+
ThreadPoolSchedulerWin::EnableThreadPoolWorkTracking(enable);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
void Test_ThreadPoolSchedulerWin_WaitForThreadPoolWorkCompletion() noexcept {
|
|
252
|
+
ThreadPoolSchedulerWin::WaitForThreadPoolWorkCompletion();
|
|
253
|
+
}
|
|
254
|
+
|
|
163
255
|
} // namespace Mso
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.67.
|
|
13
|
+
<ReactNativeWindowsVersion>0.67.8</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>67</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>8</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
18
|
</PropertyGroup>
|
|
19
19
|
</Project>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@react-native-community/cli": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.67.
|
|
30
|
-
"@react-native-windows/virtualized-list": "0.67.
|
|
29
|
+
"@react-native-windows/cli": "0.67.2",
|
|
30
|
+
"@react-native-windows/virtualized-list": "0.67.1",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "2.0.0",
|
|
33
33
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ws": "^6.1.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@react-native-windows/codegen": "0.67.
|
|
60
|
+
"@react-native-windows/codegen": "0.67.1",
|
|
61
61
|
"@rnw-scripts/eslint-config": "1.1.8",
|
|
62
62
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.0.2",
|
|
63
63
|
"@rnx-kit/jest-preset": "^0.1.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react-native": "^0.67.0"
|
|
84
84
|
},
|
|
85
85
|
"beachball": {
|
|
86
|
-
"defaultNpmTag": "
|
|
86
|
+
"defaultNpmTag": "v0.67-stable",
|
|
87
87
|
"gitTags": true,
|
|
88
88
|
"disallowedChangeTypes": [
|
|
89
89
|
"major",
|