Backed out changeset 8f976ed899d7 (bug 1847231) for causing bc failures on browser_se...
[gecko.git] / js / src / jsapi-tests / testThreadingMutex.cpp
blobe3d2f1155ded65cf417aa804a3f3aa9f20c3fc33
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "jsapi-tests/tests.h"
9 #include "threading/LockGuard.h"
10 #include "vm/MutexIDs.h"
12 BEGIN_TEST(testThreadingMutex) {
13 js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex);
14 mutex.lock();
15 mutex.unlock();
16 return true;
18 END_TEST(testThreadingMutex)
20 BEGIN_TEST(testThreadingLockGuard) {
21 js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex);
22 js::LockGuard<js::Mutex> guard(mutex);
23 return true;
25 END_TEST(testThreadingLockGuard)
27 BEGIN_TEST(testThreadingUnlockGuard) {
28 js::Mutex mutex MOZ_UNANNOTATED(js::mutexid::TestMutex);
29 js::LockGuard<js::Mutex> guard(mutex);
30 js::UnlockGuard<js::Mutex> unguard(guard);
31 return true;
33 END_TEST(testThreadingUnlockGuard)