radiusplugin-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Radiusplugin-users] Thread-safety question


From: Lev Stipakov
Subject: [Radiusplugin-users] Thread-safety question
Date: Tue, 22 Jul 2014 22:19:19 +0300

Hello,

I'd like to confirm that radiusplugin does not have thread-safety issues.

In my configuraion I use authcontrol file, so main thread will execute
statement:

https://github.com/comicchang/radiusplugin/blob/master/radiusplugin.cpp#L400

> context->addNewUser(newuser);

which simply does stl::list.push_back(),

Meanwhile, auth_user_pass_verify thread runs in background and executes:

https://github.com/comicchang/radiusplugin/blob/master/radiusplugin.cpp#L908

> if (context->UserWaitingtoAuth()==false)

which calls list.size(), and, if size is not 0:

https://github.com/comicchang/radiusplugin/blob/master/radiusplugin.cpp#L925

> newuser = context->getNewUser();

which calls list.front() and list.pop_front().

As seen from the code, nothing prevents main and auth_user_pass_verify
threads to execute those statements at the same time.

Since STL does not guarantee thread-safety and there are two threads
that access and modify the same list, is synchronization missing here?
Or do I misunderstand something?


-Lev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]