aboutsummaryrefslogtreecommitdiff
path: root/zencore/session.cpp
blob: d57d3685b3b95f4b4c74ae7fc3723df811974f8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Epic Games, Inc. All Rights Reserved.

#include "zencore/session.h"

#include <zencore/uid.h>

#include <mutex>

namespace zen {

static Oid			  GlobalSessionId;
static std::once_flag SessionInitFlag;

Oid
GetSessionId()
{
	std::call_once(SessionInitFlag, [&] { GlobalSessionId.Generate(); });

	return GlobalSessionId;
}

}  // namespace zen