Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: runtime/vm/thread_test.cc

Issue 1978153002: Uses an open thread handle as the ThreadJoinId on Windows. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_test.cc
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index aa006dfb4acd8b0ef4835bc684b2859f900a446a..d0deba90426383d222693581211bc2a72ff89016 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -435,12 +435,13 @@ VM_TEST_CASE(ThreadIterator_Count) {
VM_TEST_CASE(ThreadIterator_FindSelf) {
OSThread* current = OSThread::Current();
- EXPECT(OSThread::IsThreadInList(current->join_id()));
+ EXPECT(OSThread::IsThreadInList(current->id()));
}
struct ThreadIteratorTestParams {
- ThreadId spawned_thread_join_id;
+ ThreadId spawned_thread_id;
+ ThreadJoinId spawned_thread_join_id;
Monitor* monitor;
};
@@ -452,9 +453,10 @@ void ThreadIteratorTestMain(uword parameter) {
EXPECT(thread != NULL);
MonitorLocker ml(params->monitor);
- params->spawned_thread_join_id = thread->join_id();
- EXPECT(params->spawned_thread_join_id != OSThread::kInvalidThreadJoinId);
- EXPECT(OSThread::IsThreadInList(thread->join_id()));
+ params->spawned_thread_id = thread->id();
+ params->spawned_thread_join_id = OSThread::GetCurrentThreadJoinId(thread);
+ EXPECT(params->spawned_thread_id != OSThread::kInvalidThreadId);
+ EXPECT(OSThread::IsThreadInList(thread->id()));
ml.Notify();
}
@@ -463,25 +465,25 @@ void ThreadIteratorTestMain(uword parameter) {
// on Windows. See |OnDartThreadExit| in os_thread_win.cc for more details.
TEST_CASE(ThreadIterator_AddFindRemove) {
ThreadIteratorTestParams params;
- params.spawned_thread_join_id = OSThread::kInvalidThreadJoinId;
+ params.spawned_thread_id = OSThread::kInvalidThreadId;
params.monitor = new Monitor();
{
MonitorLocker ml(params.monitor);
- EXPECT(params.spawned_thread_join_id == OSThread::kInvalidThreadJoinId);
- // Spawn thread and wait to receive the thread join id.
+ EXPECT(params.spawned_thread_id == OSThread::kInvalidThreadId);
+ // Spawn thread and wait to receive the thread id.
OSThread::Start("ThreadIteratorTest",
ThreadIteratorTestMain,
reinterpret_cast<uword>(&params));
- while (params.spawned_thread_join_id == OSThread::kInvalidThreadJoinId) {
+ while (params.spawned_thread_id == OSThread::kInvalidThreadId) {
ml.Wait();
}
+ EXPECT(params.spawned_thread_id != OSThread::kInvalidThreadId);
EXPECT(params.spawned_thread_join_id != OSThread::kInvalidThreadJoinId);
- // Join thread.
OSThread::Join(params.spawned_thread_join_id);
}
- EXPECT(!OSThread::IsThreadInList(params.spawned_thread_join_id))
+ EXPECT(!OSThread::IsThreadInList(params.spawned_thread_id))
delete params.monitor;
}
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698