Follow-up tweaks for issue #145

Because we use to pass a policy class to 'Native_capability_tpl'
we can pass the dst type as part of the policy instead of as
a separate template argument. This patch also adds documentation
of the POLICY interface as expected by 'Native_capability_tpl'.
This commit is contained in:
Norman Feske
2012-03-08 19:28:32 +01:00
parent c9c21ad39c
commit 35384faa7a
10 changed files with 85 additions and 55 deletions

View File

@@ -30,17 +30,16 @@ namespace Genode {
Native_thread_id my_thread_id();
struct Thread_id_check
{
static bool valid(Kernel::Thread_id tid) {
typedef Kernel::Thread_id Dst;
static bool valid(Dst tid) {
return tid != Kernel::INVALID_THREAD_ID; }
static Kernel::Thread_id invalid()
static Dst invalid()
{ return Kernel::INVALID_THREAD_ID; }
};
typedef Native_capability_tpl<Kernel::Thread_id,Thread_id_check> Native_capability;
typedef Native_capability_tpl<Thread_id_check> Native_capability;
typedef int Native_connection_state;
}