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

Side by Side Diff: src/vm/platform_test.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/vm/pair.h ('k') | src/vm/port.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #include <pthread.h> 5 #include <pthread.h>
6 #include <unistd.h> 6 #include <unistd.h>
7 7
8 #include "src/shared/assert.h" 8 #include "src/shared/assert.h"
9 #include "src/shared/platform.h" 9 #include "src/shared/platform.h"
10 #include "src/shared/test_case.h" 10 #include "src/shared/test_case.h"
11 11
12 #include "src/vm/thread.h" 12 #include "src/vm/thread.h"
13 13
14 namespace fletch { 14 namespace dartino {
15 15
16 static void yield() { usleep(1); } 16 static void yield() { usleep(1); }
17 17
18 static const int kLockCounterLimit = 50; 18 static const int kLockCounterLimit = 50;
19 static int busy_lock_counter = 0; 19 static int busy_lock_counter = 0;
20 20
21 static void LoopIncrement(Mutex* mutex, int rem) { 21 static void LoopIncrement(Mutex* mutex, int rem) {
22 while (true) { 22 while (true) {
23 int count = 0; 23 int count = 0;
24 int last_count = -1; 24 int last_count = -1;
(...skipping 24 matching lines...) Expand all
49 TEST_CASE(Mutex) { 49 TEST_CASE(Mutex) {
50 pthread_t other; 50 pthread_t other;
51 Mutex* mutex = Platform::CreateMutex(); 51 Mutex* mutex = Platform::CreateMutex();
52 int thread_created = pthread_create(&other, NULL, &RunTestBusyLock, mutex); 52 int thread_created = pthread_create(&other, NULL, &RunTestBusyLock, mutex);
53 EXPECT_EQ(0, thread_created); 53 EXPECT_EQ(0, thread_created);
54 LoopIncrement(mutex, 1); 54 LoopIncrement(mutex, 1);
55 pthread_join(other, NULL); 55 pthread_join(other, NULL);
56 delete mutex; 56 delete mutex;
57 } 57 }
58 58
59 } // namespace fletch 59 } // namespace dartino
OLDNEW
« no previous file with comments | « src/vm/pair.h ('k') | src/vm/port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698