| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 TEST(SpinLockTest, Torture) | 78 TEST(SpinLockTest, Torture) |
| 79 { | 79 { |
| 80 char sharedBuffer[bufferSize]; | 80 char sharedBuffer[bufferSize]; |
| 81 | 81 |
| 82 OwnPtr<WebThread> thread1 = adoptPtr(Platform::current()->createThread("thre
ad1")); | 82 OwnPtr<WebThread> thread1 = adoptPtr(Platform::current()->createThread("thre
ad1")); |
| 83 OwnPtr<WebThread> thread2 = adoptPtr(Platform::current()->createThread("thre
ad2")); | 83 OwnPtr<WebThread> thread2 = adoptPtr(Platform::current()->createThread("thre
ad2")); |
| 84 | 84 |
| 85 thread1->postTask(FROM_HERE, new Task(threadSafeBind(&threadMain, AllowCross
ThreadAccess(static_cast<char*>(sharedBuffer))))); | 85 thread1->defaultTaskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&t
hreadMain, AllowCrossThreadAccess(static_cast<char*>(sharedBuffer))))); |
| 86 thread2->postTask(FROM_HERE, new Task(threadSafeBind(&threadMain, AllowCross
ThreadAccess(static_cast<char*>(sharedBuffer))))); | 86 thread2->defaultTaskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&t
hreadMain, AllowCrossThreadAccess(static_cast<char*>(sharedBuffer))))); |
| 87 | 87 |
| 88 thread1.clear(); | 88 thread1.clear(); |
| 89 thread2.clear(); | 89 thread2.clear(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace blink | 92 } // namespace blink |
| OLD | NEW |