2 * thread.library - threading and synchronisation primitives
4 * Copyright © 2007 Robert Norris
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
10 #include "thread_intern.h"
12 #include <proto/exec.h>
14 /*****************************************************************************
17 AROS_LH0(uint32_t, CurrentThread
,
22 struct ThreadBase
*, ThreadBase
, 9, Thread
)
25 Get the ID of the running thread.
31 Numeric thread ID, or 0 if this is not a thread.
36 uint32_t id = CurrentThread();
37 printf("this is thread %d\n", id);
42 CreateThread(), DetachThread(), WaitThread(), WaitAllThreads()
46 *****************************************************************************/
51 struct _Thread
*thread
= _getthreadbytask(FindTask(NULL
), ThreadBase
);