tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

NoopThread.cpp (1212B)


      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 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "mozilla/Assertions.h"
      8 
      9 #include "threading/noop/ThreadPlatformData.h"
     10 
     11 namespace js {
     12 
     13 inline ThreadId::PlatformData* ThreadId::platformData() {
     14  return reinterpret_cast<PlatformData*>(platformData_);
     15 }
     16 
     17 inline const ThreadId::PlatformData* ThreadId::platformData() const {
     18  return reinterpret_cast<const PlatformData*>(platformData_);
     19 }
     20 
     21 ThreadId::ThreadId() {}
     22 ThreadId::operator bool() const { return false; }
     23 bool ThreadId::operator==(const ThreadId& aOther) const { return true; }
     24 bool Thread::create(void* (*aMain)(void*), void* aArg) { return false; }
     25 void Thread::join() {}
     26 void Thread::detach() {}
     27 ThreadId ThreadId::ThisThreadId() { return ThreadId(); }
     28 void ThisThread::SetName(const char*) {}
     29 void ThisThread::GetName(char*, size_t) {}
     30 void ThisThread::SleepMilliseconds(size_t) {
     31  MOZ_CRASH("There is no any implementation for sleep.");
     32 }
     33 
     34 }  // namespace js