nas: remove all uses of atomic from 4G and 5G classes

the NAS classes aren't thread safe and thread-safety shouldn't be
pretended by using atomics. Remove them and add explicit notice.
master
Andre Puschmann 3 years ago
parent c63932f514
commit 78d60bc138

@ -35,6 +35,13 @@ class usim_interface_nas;
class gw_interface_nas;
class rrc_interface_nas;
/**
* @brief This class implements the NAS layer of a EUTRA UE.
*
* The class is *NOT* thread-safe.
*
*/
class nas : public nas_interface_rrc, public srsran::timer_callback, public nas_base
{
public:

@ -33,6 +33,12 @@ using srsran::byte_buffer_t;
namespace srsue {
/**
* @brief This class implements the NAS layer of a 5G UE.
*
* The class is *NOT* thread-safe.
*
*/
class nas_5g : public nas_base, public nas_5g_interface_rrc_nr, public nas_5g_interface_procedures
{
public:

@ -74,9 +74,9 @@ public:
const std::string get_full_state_text();
private:
std::atomic<state_t> state{state_t::null};
std::atomic<deregistered_substate_t> deregistered_substate{deregistered_substate_t::null};
std::atomic<registered_substate_t> registered_substate{registered_substate_t::null};
state_t state = state_t::null;
deregistered_substate_t deregistered_substate = deregistered_substate_t::null;
registered_substate_t registered_substate = registered_substate_t::null;
srslog::basic_logger& logger = srslog::fetch_basic_logger("NAS-5G");
};

@ -14,7 +14,6 @@
#define SRSUE_NAS_EMM_STATE_H
#include "srsran/srslog/srslog.h"
#include <atomic>
#include <string>
namespace srsue {
@ -77,9 +76,9 @@ public:
const std::string get_full_state_text();
private:
std::atomic<state_t> state{state_t::null}; // The GW might require to know the NAS state from another thread
std::atomic<deregistered_substate_t> deregistered_substate{deregistered_substate_t::null};
std::atomic<registered_substate_t> registered_substate{registered_substate_t::null};
state_t state = state_t::null;
deregistered_substate_t deregistered_substate = deregistered_substate_t::null;
registered_substate_t registered_substate = registered_substate_t::null;
srslog::basic_logger& logger = srslog::fetch_basic_logger("NAS");
};

Loading…
Cancel
Save