mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
parent
e686ff78e9
commit
5440cd4b50
@ -29,7 +29,7 @@ void Thread::_thread_start()
|
||||
{
|
||||
Thread::myself()->_thread_bootstrap();
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,6 @@ void Genode::Thread::_thread_start()
|
||||
|
||||
Thread::myself()->_thread_bootstrap();
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
sleep_forever();
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ void Thread::_thread_start()
|
||||
{
|
||||
Thread::myself()->_thread_bootstrap();
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ void Thread::_thread_start()
|
||||
lx_sigsetmask(LX_SIGCHLD, false);
|
||||
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ void Thread::_thread_start()
|
||||
thread->entry();
|
||||
|
||||
/* unblock caller of 'join()' */
|
||||
thread->_join_lock.unlock();
|
||||
thread->_join.wakeup();
|
||||
|
||||
sleep_forever();
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ Native_thread &Thread::native_thread() { return *_native_thread; }
|
||||
|
||||
Thread::Thread(size_t weight, const char *name, size_t /* stack size */,
|
||||
Type, Cpu_session * cpu_sess, Affinity::Location)
|
||||
: _cpu_session(cpu_sess), _affinity(), _join_lock()
|
||||
: _cpu_session(cpu_sess), _affinity()
|
||||
{
|
||||
Native_thread::Meta_data *meta_data =
|
||||
new (global_alloc()) Thread_meta_data_created(this);
|
||||
|
@ -59,7 +59,7 @@ void Thread::_thread_start()
|
||||
throw;
|
||||
}
|
||||
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
|
||||
/* sleep silently */
|
||||
Genode::sleep_forever();
|
||||
|
@ -29,7 +29,7 @@ void Thread::_thread_start()
|
||||
{
|
||||
Thread::myself()->_thread_bootstrap();
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ void Thread::_thread_start()
|
||||
{
|
||||
Thread::myself()->_thread_bootstrap();
|
||||
Thread::myself()->entry();
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
sleep_forever();
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/exception.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/blockade.h>
|
||||
#include <base/trace/logger.h>
|
||||
#include <cpu/consts.h>
|
||||
#include <util/string.h>
|
||||
@ -129,9 +129,9 @@ class Genode::Thread
|
||||
Native_thread *_native_thread = nullptr;
|
||||
|
||||
/**
|
||||
* Lock used for synchronizing the finalization of the thread
|
||||
* Blockade used for synchronizing the finalization of the thread
|
||||
*/
|
||||
Lock _join_lock;
|
||||
Blockade _join { };
|
||||
|
||||
/**
|
||||
* Thread type
|
||||
|
@ -140,7 +140,7 @@ void Thread::name(char *dst, size_t dst_len)
|
||||
Thread::Name Thread::name() const { return _stack->name(); }
|
||||
|
||||
|
||||
void Thread::join() { _join_lock.lock(); }
|
||||
void Thread::join() { _join.block(); }
|
||||
|
||||
|
||||
void *Thread::alloc_secondary_stack(char const *name, size_t stack_size)
|
||||
@ -204,8 +204,7 @@ Thread::Thread(size_t weight, const char *name, size_t stack_size,
|
||||
_affinity(affinity),
|
||||
_trace_control(nullptr),
|
||||
_stack(type == REINITIALIZED_MAIN ?
|
||||
_stack : _alloc_stack(stack_size, name, type == MAIN)),
|
||||
_join_lock(Lock::LOCKED)
|
||||
_stack : _alloc_stack(stack_size, name, type == MAIN))
|
||||
{
|
||||
_init_platform_thread(weight, type);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ void Thread::_thread_start()
|
||||
throw;
|
||||
}
|
||||
|
||||
Thread::myself()->_join_lock.unlock();
|
||||
Thread::myself()->_join.wakeup();
|
||||
|
||||
/* sleep silently */
|
||||
Genode::sleep_forever();
|
||||
|
Loading…
Reference in New Issue
Block a user