Class ThreadUtils

java.lang.Object
com.trimblemaps.mapsdk.utils.ThreadUtils

public class ThreadUtils extends Object
Utility class to verify if execution is running on the main thread.

Verification only runs for debug builds.

  • Constructor Details

    • ThreadUtils

      public ThreadUtils()
  • Method Details

    • init

      public static ThreadUtils init(@NonNull android.content.Context context)
      Initialises the thread utils, verifies debug state of the consuming app.
      Parameters:
      context - Context hosting the TrimbleMaps Maps SDK for Android
      Returns:
      this
    • checkThread

      public static void checkThread(@NonNull String origin)
      Validates if execution is running on the main thread.
      Parameters:
      origin - the origin of the execution
    • waitForEmpty

      public static int waitForEmpty(Object lock, ArrayList<Runnable> eventQueue, long timeoutMillis)