gecko-dev/xpcom/threads/MainThreadUtils.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 строки
1.2 KiB
C
Исходник Обычный вид История

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MainThreadUtils_h_
#define MainThreadUtils_h_
#include "nscore.h"
class nsIThread;
/**
* Get a reference to the main thread.
*
* @param aResult
* The resulting nsIThread object.
*/
extern nsresult NS_GetMainThread(nsIThread** aResult);
#ifdef MOZILLA_INTERNAL_API
// Fast access to the current thread. Do not release the returned pointer! If
// you want to use this pointer from some other thread, then you will need to
// AddRef it. Otherwise, you should only consider this pointer valid from code
// running on the current thread.
extern nsIThread* NS_GetCurrentThread();
#endif
#ifdef MOZILLA_INTERNAL_API
bool NS_IsMainThreadTLSInitialized();
Bug 1490496 - implement XPCOM FFI for key-value storage r=nika,lina,mossop MozReview-Commit-ID: JnQzXG581DW Differential Revision: https://phabricator.services.mozilla.com/D6328 --HG-- rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.3.2/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.3.2/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.3.2/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/crossbeam-utils-0.3.2/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.3.2/README.md rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.3.2/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils-0.3.2/src/consume.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.3.2/src/lib.rs rename : third_party/rust/crossbeam-utils/src/scoped.rs => third_party/rust/crossbeam-utils-0.3.2/src/scoped.rs rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils/src/atomic/consume.rs rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/threadbound/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/threadbound/LICENSE-MIT rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.6.5/.cargo-checksum.json rename : third_party/rust/uuid/CODE_OF_CONDUCT.md => third_party/rust/uuid-0.6.5/CODE_OF_CONDUCT.md rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/uuid-0.6.5/LICENSE-MIT rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.6.5/README.md rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid-0.6.5/benches/parse_str.rs rename : third_party/rust/uuid/src/adapter.rs => third_party/rust/uuid-0.6.5/src/adapter.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.6.5/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.6.5/src/lib.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.6.5/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.6.5/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.6.5/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.6.5/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.6.5/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.6.5/src/u128_support.rs rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid/benches/invalid_parse_str.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid/src/parser/std_support.rs extra : moz-landing-system : lando
2019-02-07 19:14:04 +03:00
extern "C" {
bool NS_IsMainThread();
Bug 1490496 - implement XPCOM FFI for key-value storage r=nika,lina,mossop MozReview-Commit-ID: JnQzXG581DW Differential Revision: https://phabricator.services.mozilla.com/D6328 --HG-- rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.3.2/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.3.2/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.3.2/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/crossbeam-utils-0.3.2/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.3.2/README.md rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.3.2/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils-0.3.2/src/consume.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.3.2/src/lib.rs rename : third_party/rust/crossbeam-utils/src/scoped.rs => third_party/rust/crossbeam-utils-0.3.2/src/scoped.rs rename : third_party/rust/crossbeam-utils/src/consume.rs => third_party/rust/crossbeam-utils/src/atomic/consume.rs rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/threadbound/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/threadbound/LICENSE-MIT rename : third_party/rust/uuid/.cargo-checksum.json => third_party/rust/uuid-0.6.5/.cargo-checksum.json rename : third_party/rust/uuid/CODE_OF_CONDUCT.md => third_party/rust/uuid-0.6.5/CODE_OF_CONDUCT.md rename : third_party/rust/uuid/Cargo.toml => third_party/rust/uuid-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-utils/LICENSE-MIT => third_party/rust/uuid-0.6.5/LICENSE-MIT rename : third_party/rust/uuid/README.md => third_party/rust/uuid-0.6.5/README.md rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid-0.6.5/benches/parse_str.rs rename : third_party/rust/uuid/src/adapter.rs => third_party/rust/uuid-0.6.5/src/adapter.rs rename : third_party/rust/uuid/src/core_support.rs => third_party/rust/uuid-0.6.5/src/core_support.rs rename : third_party/rust/uuid/src/lib.rs => third_party/rust/uuid-0.6.5/src/lib.rs rename : third_party/rust/uuid/src/prelude.rs => third_party/rust/uuid-0.6.5/src/prelude.rs rename : third_party/rust/uuid/src/serde_support.rs => third_party/rust/uuid-0.6.5/src/serde_support.rs rename : third_party/rust/uuid/src/slog_support.rs => third_party/rust/uuid-0.6.5/src/slog_support.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid-0.6.5/src/std_support.rs rename : third_party/rust/uuid/src/test_util.rs => third_party/rust/uuid-0.6.5/src/test_util.rs rename : third_party/rust/uuid/src/u128_support.rs => third_party/rust/uuid-0.6.5/src/u128_support.rs rename : third_party/rust/uuid/benches/parse_str.rs => third_party/rust/uuid/benches/invalid_parse_str.rs rename : third_party/rust/uuid/src/std_support.rs => third_party/rust/uuid/src/parser/std_support.rs extra : moz-landing-system : lando
2019-02-07 19:14:04 +03:00
}
namespace mozilla {
# ifdef DEBUG
void AssertIsOnMainThread();
# else
inline void AssertIsOnMainThread() {}
# endif
} // namespace mozilla
#endif
#endif // MainThreadUtils_h_