Skip to content

Commit

Permalink
Merge pull request #233 from whoshuu/issue/46/unlock-shutdown-mutex
Browse files Browse the repository at this point in the history
Unlock shutdown mutex
  • Loading branch information
whoshuu committed Oct 27, 2017
2 parents 1224768 + e7ba281 commit c87f18a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
version: '1.1.{build}'
configuration:
- release
- RELEASE
- DEBUG
os: Visual Studio 2015
before_build:
- git submodule update --init --recursive
- set CMAKE_USE_OPENSSL=OFF
- mkdir build
- cd build
- cmake .. -G "Visual Studio 14 2015"
- cmake -DCMAKE_BUILD_TYPE=%Configuration% .. -G "Visual Studio 14 2015"
build:
project: C:\projects\cpr\build\cpr.sln
test_script:
Expand Down
6 changes: 5 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ macro(add_cpr_test _TEST_NAME)
# Group under the "tests" project folder in IDEs such as Visual Studio.
set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests")
if(WIN32)
set(LIBCURL_DLL_NAME "libcurl.dll")
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(LIBCURL_DLL_NAME "libcurl-d.dll")
endif()
add_custom_command(TARGET ${_TEST_NAME}_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE_DIR:libcurl>/libcurl.dll $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)
$<TARGET_FILE_DIR:libcurl>/${LIBCURL_DLL_NAME} $<TARGET_FILE_DIR:${_TEST_NAME}_tests>)
endif()
endmacro()

Expand Down
1 change: 1 addition & 0 deletions test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ void runServer(struct mg_server* server) {
mg_poll_server(server, 1000);
} while (!shutdown_mutex.try_lock());

shutdown_mutex.unlock();
std::lock_guard<std::mutex> server_lock(server_mutex);
mg_destroy_server(&server);
server_cv.notify_one();
Expand Down

0 comments on commit c87f18a

Please sign in to comment.