diff options
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/thread.cpp | 12 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/vespalib/src/vespa/vespalib/util/thread.cpp b/vespalib/src/vespa/vespalib/util/thread.cpp index d9341c7ec43..2d0118645ab 100644 --- a/vespalib/src/vespa/vespalib/util/thread.cpp +++ b/vespalib/src/vespa/vespalib/util/thread.cpp @@ -4,12 +4,12 @@ namespace vespalib { -__thread Thread *Thread::_currentThread = 0; +__thread Thread *Thread::_currentThread = nullptr; void Thread::Proxy::Run(FastOS_ThreadInterface *, void *) { - assert(_currentThread == 0); + assert(_currentThread == nullptr); _currentThread = &thread; start.await(); if (!cancel) { @@ -17,10 +17,10 @@ Thread::Proxy::Run(FastOS_ThreadInterface *, void *) runnable.run(); } assert(_currentThread == &thread); - _currentThread = 0; + _currentThread = nullptr; } -Thread::Proxy::~Proxy() { } +Thread::Proxy::~Proxy() = default; Thread::Thread(Runnable &runnable) : _proxy(*this, runnable), @@ -30,7 +30,7 @@ Thread::Thread(Runnable &runnable) _woken(false) { FastOS_ThreadInterface *thread = _pool.NewThread(&_proxy); - assert(thread != 0); + assert(thread != nullptr); (void)thread; } @@ -80,7 +80,7 @@ Thread & Thread::currentThread() { Thread *thread = _currentThread; - assert(thread != 0); + assert(thread != nullptr); return *thread; } diff --git a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp index 21d1de2a29b..ea657d4ec76 100644 --- a/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp +++ b/vespalib/src/vespa/vespalib/util/threadstackexecutorbase.cpp @@ -150,7 +150,7 @@ ThreadStackExecutorBase::start(uint32_t threads) assert(threads > 0); for (uint32_t i = 0; i < threads; ++i) { FastOS_ThreadInterface *thread = _pool->NewThread(_thread_init.get()); - assert(thread != 0); + assert(thread != nullptr); (void)thread; } } @@ -200,7 +200,7 @@ ThreadStackExecutorBase::execute(Task::UP task) } else { ++_stats.rejectedTasks; } - return std::move(task); + return task; } ThreadStackExecutorBase & |