package cgmblelib.database.source.db;

import android.os.Looper;

/**
 * Created by minyuchun on 2019/10/30.
 * @author minyuchun
 * 数据来源基库
 */

public class DBDataSource {
    /**
     * 是否运行在主线程
     * @return 是否在主线程
     */
    public boolean isMainThread(){
        return Looper.myLooper() == Looper.getMainLooper();
    }

    /**
     * 验证属于子线程
     */
    public void CheckIoThread(){
        if (isMainThread()){
            throw new UnsupportedOperationException("Please run in IOThread");
        }
    }

}
