Interface IThreadChecker

All Known Implementing Classes:
NoOpThreadChecker, ThreadChecker

@Internal public interface IThreadChecker
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the system id of the current thread.
    boolean
    Checks if the calling/current thread is the Main/UI thread
    boolean
    isMainThread(long threadId)
     
    boolean
    isMainThread(@NotNull SentryThread sentryThread)
    Checks if a given thread is the Main/UI thread
    boolean
    isMainThread(@NotNull Thread thread)
    Checks if a given thread is the Main/UI thread
  • Method Details

    • isMainThread

      boolean isMainThread(long threadId)
    • isMainThread

      boolean isMainThread(@NotNull @NotNull Thread thread)
      Checks if a given thread is the Main/UI thread
      Parameters:
      thread - the Thread
      Returns:
      true if it is the main thread or false otherwise
    • isMainThread

      boolean isMainThread()
      Checks if the calling/current thread is the Main/UI thread
      Returns:
      true if it is the main thread or false otherwise
    • isMainThread

      boolean isMainThread(@NotNull @NotNull SentryThread sentryThread)
      Checks if a given thread is the Main/UI thread
      Parameters:
      sentryThread - the SentryThread
      Returns:
      true if it is the main thread or false otherwise
    • currentThreadSystemId

      long currentThreadSystemId()
      Returns the system id of the current thread. Currently only used for Android.
      Returns:
      the current thread system id.