Compare commits

..

No commits in common. "38ad2c057c35810800917e55b6a07daea31a34c0" and "11cb3ce998dfac61df9a8bb5099b075a979b4762" have entirely different histories.

3 changed files with 15 additions and 29 deletions

View File

@ -153,10 +153,6 @@ deploy_all:
script: script:
- ls -lah - ls -lah
- dnf -y install git
- mkdir -p release/source_code
- git bundle create release/source_code/source_code.bundle --all
- "echo \"This is a git bundle of the full repo, to use: git clone source_code.bundle --branch master\" > release/source_code/Readme.txt"
- mv linux release/ - mv linux release/
- shopt -s extglob - shopt -s extglob
- rm -rf .g* - rm -rf .g*

View File

@ -21,7 +21,7 @@
#define STEAMAPI_API static #define STEAMAPI_API static
#define STEAMCLIENT_API S_API_EXPORT #define STEAMCLIENT_API S_API_EXPORT
#else #else
#define STEAMAPI_API S_API_EXPORT #define STEAMAPI_API S_API
#define STEAMCLIENT_API static #define STEAMCLIENT_API static
#endif #endif

View File

@ -18,25 +18,25 @@
#include "steam_client.h" #include "steam_client.h"
#include "settings_parser.h" #include "settings_parser.h"
#include <condition_variable> static bool kill_background_thread;
static std::condition_variable kill_background_thread_cv;
static std::atomic_bool kill_background_thread;
static void background_thread(Steam_Client *client) static void background_thread(Steam_Client *client)
{ {
PRINT_DEBUG("background thread starting\n"); PRINT_DEBUG("background thread starting\n");
std::mutex mtx;
std::unique_lock<std::mutex> lck(mtx);
while (1) { while (1) {
if (kill_background_thread || kill_background_thread_cv.wait_for(lck, std::chrono::seconds(1)) != std::cv_status::timeout) { std::this_thread::sleep_for(std::chrono::seconds(1));
if (kill_background_thread) { global_mutex.lock();
PRINT_DEBUG("background thread exit\n"); bool net_alive = client->network->isAlive();
return; if (!net_alive || kill_background_thread) {
global_mutex.unlock();
if (!net_alive) {
//delete network;
} }
kill_background_thread = false;
PRINT_DEBUG("background thread exit\n");
return;
} }
global_mutex.lock();
PRINT_DEBUG("background thread run\n"); PRINT_DEBUG("background thread run\n");
client->network->Run(); client->network->Run();
client->steam_matchmaking->RunBackground(); client->steam_matchmaking->RunBackground();
@ -730,18 +730,8 @@ void Steam_Client::SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction
bool Steam_Client::BShutdownIfAllPipesClosed() bool Steam_Client::BShutdownIfAllPipesClosed()
{ {
PRINT_DEBUG("BShutdownIfAllPipesClosed\n"); PRINT_DEBUG("BShutdownIfAllPipesClosed\n");
if (!steam_pipes.size()) { kill_background_thread = true;
if (background_keepalive.joinable()) { return true;
kill_background_thread = true;
kill_background_thread_cv.notify_one();
background_keepalive.join();
}
PRINT_DEBUG("all pipes closed\n");
return true;
}
return false;
} }
// Expose HTTP interface // Expose HTTP interface