| | |
| | | "ApiTest" |
| | | ], |
| | | "stopAtEntry": false, |
| | | "cwd": "${workspaceFolder}", |
| | | "cwd": "${workspaceFolder}/debug", |
| | | "environment": [], |
| | | "externalConsole": false, |
| | | "MIMode": "gdb", |
| | |
| | | "type": "cppbuild", |
| | | "label": "C/C++: g++ build active file", |
| | | "command": "ninja", |
| | | "args": [ |
| | | "-C", |
| | | "debug" |
| | | ], |
| | | "args": [], |
| | | "options": { |
| | | "cwd": "${workspaceFolder}" |
| | | "cwd": "${workspaceFolder}/debug" |
| | | }, |
| | | "problemMatcher": [ |
| | | "$gcc" |
| | |
| | | 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); |
| | | }; |
| | |
| | | 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); |
| | |
| | | #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; |
| | |
| | | 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) |
| | | { |
| | |
| | | |
| | | 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) |