oscache 死锁

阅读更多

 

用value为null的key连续两次调用getFromCache时,如果不向cache中放入value,且不调用cancelUpdate,则会发生死锁。

 

try {

                    Object obj= oscache.getFromCache(key, commentRefreshPeriod);

                } catch (NeedsRefreshException e) {

//如果不能putInCache

                    oscache.cancelUpdate(key);

                }

 

 

   /**

     * Cancels a pending cache update. This should only be called by a thread

     * that received a {@link NeedsRefreshException} and was unable to generate

     * some new cache content.

     *

     * @param key The cache entry key to cancel the update of.

     */

    public void cancelUpdate(String key) {

        getCache().cancelUpdate(key);

    }

 

 

参考:

 

http://markmail.org/message/xzff2x4uw6ka37p3#query:oscache%20deadlock+page:1+mid:v4uq5vl76b5u6p76+state:results

你可能感兴趣的:(oscache 死锁)