Introduction   API Reference   Examples   Index  

Miscellaneous
[L4 Thread Library API Reference]


Functions

L4_CV L4_INLINE int l4thread_equal (l4thread_t t1, l4thread_t t2)
 Check if two thread ids are equal.
L4_CV l4thread_t l4thread_myself (void)
 Return thread id of current thread.
L4_CV l4_threadid_t l4thread_l4_id (l4thread_t thread)
 Return L4 thread id.
L4_INLINE l4thread_t l4thread_id (l4_threadid_t id)
 Return thread id for L4 thread.
L4_CV l4thread_t l4thread_get_parent (void)
 Get thread id of parent thread.
L4_CV int l4thread_lock (l4thread_t thread)
 Lock thread, this avoids manipulations by other threads, especially that the current thread gets killed by someone else.
L4_CV int l4thread_unlock (l4thread_t thread)
 Unlock thread.
L4_CV int l4thread_lock_myself (void)
 Lock current thread, this avoids manipulations by other threads, especially that the current thread gets killed by someone else.
L4_CV int l4thread_unlock_myself (void)
 Unlock current thread.
L4_CV int l4thread_get_stack (l4thread_t thread, l4_addr_t *low, l4_addr_t *high)
 Return stack address.
L4_CV int l4thread_get_stack_current (l4_addr_t *low, l4_addr_t *high)
 Return stack address of current thread.
L4_CV void l4thread_dump_threads (void)
 Dump threads to stdio.

Function Documentation

L4_CV L4_INLINE int l4thread_equal ( l4thread_t  t1,
l4thread_t  t2 
)

Check if two thread ids are equal.

Parameters:
t1 Thread id 1
t2 Thread id 2
Returns:
1 if threads are equal, 0 otherwise
Check if the threads t1 and t2 are equal.

L4_CV l4thread_t l4thread_myself ( void   ) 

Return thread id of current thread.

Returns:
thread id of the current thread.
Return id of the thread calling the function.

L4_CV l4_threadid_t l4thread_l4_id ( l4thread_t  thread  ) 

Return L4 thread id.

Parameters:
thread Thread id
Returns:
L4 thread id, L4_INVALID_ID if thread is an unused or invalid thread.
Return the L4 thread id of the thread thread.

L4_INLINE l4thread_t l4thread_id ( l4_threadid_t  id  ) 

Return thread id for L4 thread.

Parameters:
id L4 thread id
Returns:
Thread id.

L4_CV l4thread_t l4thread_get_parent ( void   ) 

Get thread id of parent thread.

Returns:
Thread id of parent thread, L4THREAD_INVALID_ID if parent not exists.

L4_CV int l4thread_lock ( l4thread_t  thread  ) 

Lock thread, this avoids manipulations by other threads, especially that the current thread gets killed by someone else.

Parameters:
thread Thread id
Returns:
0 on success, error code otherwise:
  • -L4_EINVAL invalid thread id

L4_CV int l4thread_unlock ( l4thread_t  thread  ) 

Unlock thread.

Parameters:
thread Thread id
Returns:
0 on success, error code otherwise:
  • -L4_EINVAL invalid thread id

L4_CV int l4thread_lock_myself ( void   ) 

Lock current thread, this avoids manipulations by other threads, especially that the current thread gets killed by someone else.

Returns:
0 on success, error code otherwise:
  • -L4_EINVAL current thread not found in thread table

L4_CV int l4thread_unlock_myself ( void   ) 

Unlock current thread.

Returns:
0 on success, error code otherwise:
  • -L4_EINVAL current thread not found in thread table

L4_CV int l4thread_get_stack ( l4thread_t  thread,
l4_addr_t *  low,
l4_addr_t *  high 
)

Return stack address.

Parameters:
thread Thread id
Return values:
stack_low Stack address low
stack_high Stack address high
Returns:
0 on success, error code otherwise:
  • -L4_EINVAL invalid thread id

L4_CV int l4thread_get_stack_current ( l4_addr_t *  low,
l4_addr_t *  high 
)

Return stack address of current thread.

Return values:
stack_low Stack address low
stack_high Stack address high
Returns:
0 on success, error code otherwise:
  • -L4_EINVAL current thread not found in thread table


L4 Thread Library Reference Manual, written by Lars Reuther  © 2000-2003