8#include <QtCore/qglobal.h>
9#include <QtCore/qdeadlinetimer.h>
15class QSemaphorePrivate;
19 explicit QSemaphore(
int n = 0);
22 void acquire(
int n = 1);
23 bool tryAcquire(
int n = 1);
24 QT_CORE_INLINE_SINCE(6, 6)
25 bool tryAcquire(
int n,
int timeout);
26 bool tryAcquire(
int n, QDeadlineTimer timeout);
27#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
28 template <
typename Rep,
typename Period>
29 bool tryAcquire(
int n, std::chrono::duration<Rep, Period> timeout)
30 {
return tryAcquire(n, QDeadlineTimer(timeout)); }
33 void release(
int n = 1);
35 int available()
const;
38 bool try_acquire()
noexcept {
return tryAcquire(); }
39 template <
typename Rep,
typename Period>
40 bool try_acquire_for(
const std::chrono::duration<Rep, Period> &timeout)
41 {
return tryAcquire(1, timeout); }
42 template <
typename Clock,
typename Duration>
43 bool try_acquire_until(
const std::chrono::time_point<Clock, Duration> &tp)
45 return try_acquire_for(tp - Clock::now());
48 Q_DISABLE_COPY(QSemaphore)
52 QBasicAtomicInteger<quintptr> u;
53 QBasicAtomicInteger<quint32> u32[2];
54 QBasicAtomicInteger<quint64> u64;
58#if QT_CORE_INLINE_IMPL_SINCE(6
, 6
)
59bool QSemaphore::tryAcquire(
int n,
int timeout)
61 return tryAcquire(n, QDeadlineTimer(timeout));
\preliminary \inmodule QtCorePrivate
Q_CORE_EXPORT void unregisterNewIntentListener(NewIntentListener *listener)
Q_CORE_EXPORT int acuqireServiceSetup(int flags)
Q_CORE_EXPORT void registerNewIntentListener(NewIntentListener *listener)
Q_CORE_EXPORT void unregisterResumePauseListener(ResumePauseListener *listener)
Q_CORE_EXPORT void unregisterGenericMotionEventListener(GenericMotionEventListener *listener)
Q_CORE_EXPORT bool acquireAndroidDeadlockProtector()
Q_CORE_EXPORT void unregisterKeyEventListener(KeyEventListener *listener)
Q_CORE_EXPORT void handleResume()
Q_CORE_EXPORT void registerResumePauseListener(ResumePauseListener *listener)
Q_CORE_EXPORT void releaseAndroidDeadlockProtector()
Q_CORE_EXPORT void handleNewIntent(JNIEnv *env, jobject intent)
Q_CORE_EXPORT void setOnBindListener(OnBindListener *listener)
Q_CORE_EXPORT void registerKeyEventListener(KeyEventListener *listener)
Q_CORE_EXPORT void handlePause()
Q_CORE_EXPORT bool isUncompressedNativeLibs()
Q_CORE_EXPORT void unregisterActivityResultListener(ActivityResultListener *listener)
Q_CORE_EXPORT void registerGenericMotionEventListener(GenericMotionEventListener *listener)
Q_CORE_EXPORT void handleActivityResult(jint requestCode, jint resultCode, jobject data)
Q_CORE_EXPORT void waitForServiceSetup()
Q_CORE_EXPORT void registerActivityResultListener(ActivityResultListener *listener)
Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames, { { Qt::DisplayRole, "display" }, { Qt::DecorationRole, "decoration" }, { Qt::EditRole, "edit" }, { Qt::ToolTipRole, "toolTip" }, { Qt::StatusTipRole, "statusTip" }, { Qt::WhatsThisRole, "whatsThis" }, }) const QHash< int
Q_DECLARE_JNI_NATIVE_METHOD(dispatchKeyEvent)
Q_DECLARE_JNI_NATIVE_METHOD(dispatchGenericMotionEvent)
static jobject g_jClassLoader
static jboolean dispatchGenericMotionEvent(JNIEnv *, jclass, QtJniTypes::MotionEvent event)
Q_GLOBAL_STATIC(QReadWriteLock, g_updateMutex)
static jobject g_jActivity
Q_DECLARE_JNI_CLASS(MotionEvent, "android/view/MotionEvent")
static jboolean updateNativeActivity(JNIEnv *env, jclass=nullptr)
static jboolean dispatchKeyEvent(JNIEnv *, jclass, QtJniTypes::KeyEvent event)
static jobject g_jService