mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 11:27:29 +00:00
parent
169cad6059
commit
1609d8a92f
@ -177,9 +177,9 @@ bool Cpu_session_component::stop_new_threads()
|
||||
}
|
||||
|
||||
|
||||
Lock &Cpu_session_component::stop_new_threads_lock()
|
||||
Mutex &Cpu_session_component::stop_new_threads_mutex()
|
||||
{
|
||||
return _stop_new_threads_lock;
|
||||
return _stop_new_threads_mutex;
|
||||
}
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ int Cpu_session_component::handle_initial_breakpoint(unsigned long lwpid)
|
||||
|
||||
void Cpu_session_component::pause_all_threads()
|
||||
{
|
||||
Lock::Guard stop_new_threads_lock_guard(stop_new_threads_lock());
|
||||
Mutex::Guard stop_new_threads_mutex_guard(stop_new_threads_mutex());
|
||||
|
||||
stop_new_threads(true);
|
||||
|
||||
@ -212,7 +212,7 @@ void Cpu_session_component::pause_all_threads()
|
||||
|
||||
void Cpu_session_component::resume_all_threads()
|
||||
{
|
||||
Lock::Guard stop_new_threads_guard(stop_new_threads_lock());
|
||||
Mutex::Guard stop_new_threads_guard(stop_new_threads_mutex());
|
||||
|
||||
stop_new_threads(false);
|
||||
|
||||
|
@ -96,7 +96,7 @@ class Gdb_monitor::Cpu_session_component : public Rpc_object<Cpu_session>
|
||||
Append_list<Cpu_thread_component> _thread_list;
|
||||
|
||||
bool _stop_new_threads = true;
|
||||
Lock _stop_new_threads_lock;
|
||||
Mutex _stop_new_threads_mutex;
|
||||
|
||||
Capability<Cpu_session::Native_cpu> _native_cpu_cap;
|
||||
|
||||
@ -136,7 +136,7 @@ class Gdb_monitor::Cpu_session_component : public Rpc_object<Cpu_session>
|
||||
void handle_unresolved_page_fault();
|
||||
void stop_new_threads(bool stop);
|
||||
bool stop_new_threads();
|
||||
Lock &stop_new_threads_lock();
|
||||
Mutex &stop_new_threads_mutex();
|
||||
int handle_initial_breakpoint(unsigned long lwpid);
|
||||
void pause_all_threads();
|
||||
void resume_all_threads();
|
||||
|
@ -149,14 +149,14 @@ int Cpu_thread_component::deliver_signal(int signo)
|
||||
}
|
||||
|
||||
/*
|
||||
* The lock guard prevents an interruption by
|
||||
* The mutex guard prevents an interruption by
|
||||
* 'genode_stop_all_threads()', which could cause
|
||||
* the new thread to be resumed when it should be
|
||||
* stopped.
|
||||
*/
|
||||
|
||||
Lock::Guard stop_new_threads_lock_guard(
|
||||
_cpu_session_component.stop_new_threads_lock());
|
||||
Mutex::Guard stop_new_threads_mutex_guard(
|
||||
_cpu_session_component.stop_new_threads_mutex());
|
||||
|
||||
if (!_cpu_session_component.stop_new_threads())
|
||||
resume();
|
||||
|
@ -61,7 +61,7 @@ class Memory_model
|
||||
{
|
||||
private:
|
||||
|
||||
Lock _lock;
|
||||
Mutex _mutex { };
|
||||
|
||||
Region_map_component &_address_space;
|
||||
|
||||
@ -160,7 +160,7 @@ class Memory_model
|
||||
|
||||
unsigned char read(void *addr)
|
||||
{
|
||||
Lock::Guard guard(_lock);
|
||||
Mutex::Guard guard(_mutex);
|
||||
|
||||
addr_t offset_in_region = 0;
|
||||
|
||||
@ -188,7 +188,7 @@ class Memory_model
|
||||
if (verbose)
|
||||
log(__func__, ": write addr=", addr, ", value=", Hex(value));
|
||||
|
||||
Lock::Guard guard(_lock);
|
||||
Mutex::Guard guard(_mutex);
|
||||
|
||||
addr_t offset_in_region = 0;
|
||||
Region_map_component::Region *region =
|
||||
|
@ -28,7 +28,7 @@ using namespace Gdb_monitor;
|
||||
|
||||
Region_map_component::Region *Region_map_component::find_region(void *local_addr, addr_t *offset_in_region)
|
||||
{
|
||||
Lock::Guard lock_guard(_region_map_lock);
|
||||
Mutex::Guard guard(_region_map_mutex);
|
||||
|
||||
Region *first = _region_map.first();
|
||||
Region *region = first ? first->find_by_addr(local_addr) : 0;
|
||||
@ -73,7 +73,7 @@ Region_map_component::attach(Dataspace_capability ds_cap, size_t size,
|
||||
use_local_addr, local_addr,
|
||||
executable, writeable);
|
||||
|
||||
Lock::Guard lock_guard(_region_map_lock);
|
||||
Mutex::Guard guard(_region_map_mutex);
|
||||
_region_map.insert(new (_alloc) Region(addr, (void*)((addr_t)addr + size - 1), ds_cap, offset));
|
||||
|
||||
return addr;
|
||||
@ -84,7 +84,7 @@ void Region_map_component::detach(Region_map::Local_addr local_addr)
|
||||
{
|
||||
_parent_region_map.detach(local_addr);
|
||||
|
||||
Lock::Guard lock_guard(_region_map_lock);
|
||||
Mutex::Guard guard(_region_map_mutex);
|
||||
Region *region = _region_map.first()->find_by_addr(local_addr);
|
||||
if (!region) {
|
||||
warning("address not in region map");
|
||||
|
@ -73,7 +73,7 @@ namespace Gdb_monitor {
|
||||
private:
|
||||
|
||||
Avl_tree<Region> _region_map;
|
||||
Lock _region_map_lock;
|
||||
Mutex _region_map_mutex;
|
||||
Dataspace_pool &_managed_ds_map;
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user