isUIThread()
Purpose
Helper method to find out if the current thread is the UI thread or not.Examples
class SampleController { private longRunningCode() { if(isUIThread()) { throw new RuntimeException('Must NOT be called inside the UI Thread') } } }