2 * thread.library - threading and synchronisation primitives
4 * Copyright © 2008 Markus Weiss
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 /*****************************************************************************
15 AROS_LH1(void, ExitThread
,
18 AROS_LHA(void *, result
, A0
),
21 struct ThreadBase
*, ThreadBase
, 20, Thread
)
24 Exits the calling thread.
27 result - pointer to storage for the thread's return value. You can
28 pass NULL here if you don't care about the return value.
31 None, this function never returns.
34 This function is similar to the exit() function of arosc library.
42 WaitThread(), WaitAllThreads(), exit()
46 *****************************************************************************/
50 struct _Thread
*thread
= _getthreadbytask(FindTask(NULL
), ThreadBase
);
52 /* if called from a task that is not a thread */
55 thread
->result
= result
;
57 longjmp(thread
->jmp
, 1);