Code example for Lock

Methods: lock, unlock

0
 
    public FavListBean loadData() throws WeiboException { 
        FavListDao dao = new FavListDao(token);
        dao.setPage(page);
        FavListBean result = null;
        lock.lock();
 
        try { 
            result = dao.getGSONMsgList();
        } finally { 
            lock.unlock();
        } 
 
 
        return result;
    } 
 
}