lichao
2021-04-21 b3b9d91eccd3f54be112ac5389b49969fea93b4c
trivial.
5个文件已修改
27 ■■■■ 已修改文件
.vscode/launch.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/tasks.json 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
box/status_main.cc 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/shm_queue.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/socket.cpp 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/launch.json
@@ -14,7 +14,7 @@
                "ApiTest"
            ],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "cwd": "${workspaceFolder}/debug",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
.vscode/tasks.json
@@ -4,12 +4,9 @@
            "type": "cppbuild",
            "label": "C/C++: g++ build active file",
            "command": "ninja",
            "args": [
                "-C",
                "debug"
            ],
            "args": [],
            "options": {
                "cwd": "${workspaceFolder}"
                "cwd": "${workspaceFolder}/debug"
            },
            "problemMatcher": [
                "$gcc"
box/status_main.cc
@@ -62,8 +62,8 @@
                int nkb = left / Kb;
                int nb = left - nkb * Kb;
                char buf[64] = {0};
                int n = sprintf(buf, " %4dMb %4dKb %4dB", nmb, nkb, nb);
                int start = (nmb > 0) ? 0 : ((nkb > 0) ? 7 : 14);
                int n = sprintf(buf, " %4dM%4dK%4dB", nmb, nkb, nb);
                int start = (nmb > 0) ? 0 : ((nkb > 0) ? 5 : 10);
                buf[start] = sign;
                return std::string(buf + start);
            };
@@ -74,7 +74,7 @@
                printf("%s", buf);
                if (new_line) {
                    auto diff = cur - last;
                    printf(" (%+ld = %s)\n", diff, Pretty(diff).c_str());
                    printf(" (%+6ld = %s)\n", diff, Pretty(diff).c_str());
                    printf("%s", buf);
                }
                fflush(stdout);
src/shm_queue.cpp
@@ -21,11 +21,6 @@
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
// TODO !!! add garbage collection, and handshake with gc-center.
// smart pointer will NOT work if user crash.
// problem of process release mq: client query success; server exits; client send.
//  client query success; server exits; client send.
namespace bhome_shm
{
using namespace bhome_msg;
src/socket.cpp
@@ -24,11 +24,6 @@
using namespace bhome_msg;
using namespace bhome_shm;
namespace
{
} // namespace
ShmSocket::ShmSocket(Shm &shm, const MQId &id, const int len) :
    run_(false), mq_(id, shm, len)
{
@@ -42,7 +37,7 @@
ShmSocket::~ShmSocket()
{
    Stop(); //TODO should stop in sub class, incase thread access sub class data.
    Stop();
}
bool ShmSocket::Start(int nworker, const RecvCB &onData, const IdleCB &onIdle)