Skip to content

Commit

Permalink
Merge pull request #245 from tensorlayer/lg-fix
Browse files Browse the repository at this point in the history
compatibility fix
  • Loading branch information
ganler authored Apr 11, 2020
2 parents 3c8ed52 + 1888f7e commit 0e6afe3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions cmake/3rdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ SET(STDTENSOR_GIT_URL
https://github.com/stdml/stdtensor.git
CACHE STRING "URL for clone stdtensor")

SET(STDTENSOR_GIT_TAG
"v0.9.1"
CACHE STRING "git tag for checkout stdtensor")

EXTERNALPROJECT_ADD(
stdtensor-repo
LOG_DOWNLOAD ON
LOG_INSTALL ON
LOG_CONFIGURE ON
GIT_REPOSITORY ${STDTENSOR_GIT_URL}
GIT_TAG v0.9.0
GIT_TAG ${STDTENSOR_GIT_TAG}
PREFIX ${THIRDPARTY_PREFIX}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${THIRDPARTY_PREFIX} -DBUILD_TESTS=0
-DBUILD_EXAMPLES=0)
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${THIRDPARTY_PREFIX} -DBUILD_TESTS=0 #
-DUSE_STRICT=0 -DBUILD_LIB=0 -DBUILD_EXAMPLES=0)

INCLUDE_DIRECTORIES(${THIRDPARTY_PREFIX}/include)

Expand Down
6 changes: 3 additions & 3 deletions examples/thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ simple_thread_pool::simple_thread_pool(std::size_t sz)
{
std::unique_lock<std::mutex> lock(ptr->queue_mu);
ptr->cv.wait(lock, [&] {
return ptr->shutdown or !ptr->queue.empty();
return ptr->shutdown || !ptr->queue.empty();
});
if (ptr->shutdown and ptr->queue.empty())
if (ptr->shutdown && ptr->queue.empty())
return; // Conditions to let the thread go.
task = std::move(ptr->queue.front());
ptr->queue.pop();
Expand Down Expand Up @@ -45,4 +45,4 @@ simple_thread_pool::~simple_thread_pool()
m_shared_src->shutdown = true;
std::atomic_signal_fence(std::memory_order_seq_cst);
m_shared_src->cv.notify_all();
}
}

0 comments on commit 0e6afe3

Please sign in to comment.