linux: use Mutex

Fixes #3807
This commit is contained in:
Alexander Boettcher
2020-07-07 11:41:44 +02:00
committed by Norman Feske
parent a0b0892df3
commit ce6f4dffe5
5 changed files with 11 additions and 13 deletions

View File

@ -43,8 +43,8 @@ namespace Genode {
struct Registry
{
Lock _lock { };
List<Platform_thread> _list { };
Mutex _mutex { };
List<Platform_thread> _list { };
void insert(Platform_thread *thread);
void remove(Platform_thread *thread);

View File

@ -15,7 +15,6 @@
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
#include <base/allocator.h>
#include <base/lock.h>
#include <base/capability.h>
namespace Genode { class Rpc_cap_factory; }

View File

@ -12,7 +12,6 @@
*/
/* Genode includes */
#include <base/lock.h>
#include <linux_dataspace/client.h>
/* base-internal includes */

View File

@ -32,21 +32,21 @@ typedef Token<Scanner_policy_identifier_with_underline> Tid_token;
void Platform_thread::Registry::insert(Platform_thread *thread)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
_list.insert(thread);
}
void Platform_thread::Registry::remove(Platform_thread *thread)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
_list.remove(thread);
}
void Platform_thread::Registry::submit_exception(unsigned long pid)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
/* traverse list to find 'Platform_thread' with matching PID */
for (Platform_thread *curr = _list.first(); curr; curr = curr->next()) {