X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FThreadCachedInt.h;h=d573ed656723d5ef0bc8fb1b2a1aab22b4cdbc2c;hb=8c62ae77eeadc77735fa31a695c8c6f2ca81f2d2;hp=a255f1993e2f5fe77ba765fc0fedd74a6815aa33;hpb=27494a20393fa45072e7d526d358835f3abe312a;p=folly.git diff --git a/folly/ThreadCachedInt.h b/folly/ThreadCachedInt.h index a255f199..d573ed65 100644 --- a/folly/ThreadCachedInt.h +++ b/folly/ThreadCachedInt.h @@ -1,5 +1,5 @@ /* - * Copyright 2012 Facebook, Inc. + * Copyright 2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,11 @@ #define FOLLY_THREADCACHEDINT_H #include -#include "folly/Likely.h" -#include "folly/ThreadLocal.h" + +#include + +#include +#include namespace folly { @@ -45,7 +48,7 @@ class ThreadCachedInt : boost::noncopyable { void increment(IntT inc) { auto cache = cache_.get(); - if (UNLIKELY(cache == NULL || cache->parent_ == NULL)) { + if (UNLIKELY(cache == nullptr || cache->parent_ == nullptr)) { cache = new IntCache(*this); cache_.reset(cache); } @@ -119,7 +122,7 @@ class ThreadCachedInt : boost::noncopyable { // need to make sure we signal that this parent is dead. ~ThreadCachedInt() { for (auto& cache : cache_.accessAllThreads()) { - cache.parent_ = NULL; + cache.parent_ = nullptr; } }