Async Mutex in Microsoft CppRest SDK

61 Views Asked by At

I try to share some data between processes in my backend. How to protect them in async application without mutexes? I try to find something in documentation, but there is nothing in search on 'mutex' request.

I expect something like this:

http_listener listener(on_host);
listener.support([](http_request request) {
    GLOBAL_VAR.Async_Mutex.lock(); {
        GLOBAL_VAR.do_something();
    } GLOBAL_VAR.Async_Mutex.unlock();
    return request.reply(200);
});
listener
    .open()
    .wait();
0

There are 0 best solutions below