⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test-lock.cc

📁 Google浏览器V8内核代码
💻 CC
字号:
// Copyright 2006-2008 the V8 project authors. All rights reserved.//// Tests of the TokenLock class from lock.h#include <stdlib.h>#include "v8.h"#include "platform.h"#include "cctest.h"using namespace ::v8::internal;// Simple test of locking logicTEST(Simple) {  Mutex* mutex = OS::CreateMutex();  CHECK_EQ(0, mutex->Lock());  // acquire the lock with the right token  CHECK_EQ(0, mutex->Unlock());  // can unlock with the right token  delete mutex;}TEST(MultiLock) {  Mutex* mutex = OS::CreateMutex();  CHECK_EQ(0, mutex->Lock());  CHECK_EQ(0, mutex->Unlock());  delete mutex;}TEST(ShallowLock) {  Mutex* mutex = OS::CreateMutex();  CHECK_EQ(0, mutex->Lock());  CHECK_EQ(0, mutex->Unlock());  CHECK_EQ(0, mutex->Lock());  CHECK_EQ(0, mutex->Unlock());  delete mutex;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -