[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Radiusplugin-devel] Thread-safety question
From: |
Lev Stipakov |
Subject: |
[Radiusplugin-devel] Thread-safety question |
Date: |
Tue, 22 Jul 2014 22:22:46 +0300 |
Hello,
Sorry for spamming in radiusplugin-users mail list. This question
belongs to devel.
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Radiusplugin-devel] Thread-safety question,
Lev Stipakov <=