JSON adapter needs this

synchronous
Volker Birk 3 years ago
parent 3a6faa4a0e
commit d4d114ff15

@ -42,6 +42,14 @@ namespace pEp {
::utility::locked_queue< SYNC_EVENT, ::free_Sync_event > q;
std::mutex m;
std::thread::id sync_thread_id()
{
if (_sync_thread)
return _sync_thread->get_id();
else
return std::thread::id();
}
int _inject_sync_event(SYNC_EVENT ev, void *management)
{
try {

@ -5,8 +5,9 @@
#include <functional>
#include <string>
#include <pEp/sync_api.h>
#include <thread>
#include <stdexcept>
#include <pEp/sync_api.h>
namespace pEp {
@ -36,6 +37,9 @@ namespace pEp {
// returns 'true' when called from the "sync" thread, 'false' otherwise.
bool on_sync_thread();
// returns the thread id of the sync thread
std::thread::id sync_thread_id();
enum session_action {
init,
release

Loading…
Cancel
Save