#ifndef INLINE_THREAD_H
#define INLINE_THREAD_H

/*
    *** Automatically generated from '/home/aros/ABIv0/Build/20110803/AROS/workbench/libs/thread/thread.conf'. Edits will be lost. ***
    Copyright © 1995-2011, The AROS Development Team. All rights reserved.
*/

/*
    Desc: Inline function for thread
*/

#include <aros/libcall.h>
#include <exec/types.h>
#include <aros/preprocessor/variadic/cast2iptr.hpp>


static inline uint32_t __inline_Thread_CreateThread(ThreadEntryFunction __arg1, void * __arg2, APTR __ThreadBase)
{
    return AROS_LC2(uint32_t, CreateThread,
        AROS_LCA(ThreadEntryFunction,(__arg1),A0),
        AROS_LCA(void *,(__arg2),A1),
        struct Library *, (__ThreadBase), 5, Thread    );
}

#define CreateThread(arg1, arg2) \
    __inline_Thread_CreateThread((arg1), (arg2), (APTR)ThreadBase)

static inline BOOL __inline_Thread_WaitThread(uint32_t __arg1, void ** __arg2, APTR __ThreadBase)
{
    return AROS_LC2(BOOL, WaitThread,
        AROS_LCA(uint32_t,(__arg1),D0),
        AROS_LCA(void **,(__arg2),A0),
        struct Library *, (__ThreadBase), 6, Thread    );
}

#define WaitThread(arg1, arg2) \
    __inline_Thread_WaitThread((arg1), (arg2), (APTR)ThreadBase)

static inline void __inline_Thread_WaitAllThreads(APTR __ThreadBase)
{
    AROS_LC0NR(void, WaitAllThreads,
        struct Library *, (__ThreadBase), 7, Thread    );
}

#define WaitAllThreads() \
    __inline_Thread_WaitAllThreads((APTR)ThreadBase)

static inline BOOL __inline_Thread_DetachThread(uint32_t __arg1, APTR __ThreadBase)
{
    return AROS_LC1(BOOL, DetachThread,
        AROS_LCA(uint32_t,(__arg1),D0),
        struct Library *, (__ThreadBase), 8, Thread    );
}

#define DetachThread(arg1) \
    __inline_Thread_DetachThread((arg1), (APTR)ThreadBase)

static inline uint32_t __inline_Thread_CurrentThread(APTR __ThreadBase)
{
    return AROS_LC0(uint32_t, CurrentThread,
        struct Library *, (__ThreadBase), 9, Thread    );
}

#define CurrentThread() \
    __inline_Thread_CurrentThread((APTR)ThreadBase)

static inline void * __inline_Thread_CreateMutex(APTR __ThreadBase)
{
    return AROS_LC0(void *, CreateMutex,
        struct Library *, (__ThreadBase), 10, Thread    );
}

#define CreateMutex() \
    __inline_Thread_CreateMutex((APTR)ThreadBase)

static inline BOOL __inline_Thread_DestroyMutex(void * __arg1, APTR __ThreadBase)
{
    return AROS_LC1(BOOL, DestroyMutex,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 11, Thread    );
}

#define DestroyMutex(arg1) \
    __inline_Thread_DestroyMutex((arg1), (APTR)ThreadBase)

static inline void __inline_Thread_LockMutex(void * __arg1, APTR __ThreadBase)
{
    AROS_LC1NR(void, LockMutex,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 12, Thread    );
}

#define LockMutex(arg1) \
    __inline_Thread_LockMutex((arg1), (APTR)ThreadBase)

static inline BOOL __inline_Thread_TryLockMutex(void * __arg1, APTR __ThreadBase)
{
    return AROS_LC1(BOOL, TryLockMutex,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 13, Thread    );
}

#define TryLockMutex(arg1) \
    __inline_Thread_TryLockMutex((arg1), (APTR)ThreadBase)

static inline void __inline_Thread_UnlockMutex(void * __arg1, APTR __ThreadBase)
{
    AROS_LC1NR(void, UnlockMutex,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 14, Thread    );
}

#define UnlockMutex(arg1) \
    __inline_Thread_UnlockMutex((arg1), (APTR)ThreadBase)

static inline void * __inline_Thread_CreateCondition(APTR __ThreadBase)
{
    return AROS_LC0(void *, CreateCondition,
        struct Library *, (__ThreadBase), 15, Thread    );
}

#define CreateCondition() \
    __inline_Thread_CreateCondition((APTR)ThreadBase)

static inline BOOL __inline_Thread_DestroyCondition(void * __arg1, APTR __ThreadBase)
{
    return AROS_LC1(BOOL, DestroyCondition,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 16, Thread    );
}

#define DestroyCondition(arg1) \
    __inline_Thread_DestroyCondition((arg1), (APTR)ThreadBase)

static inline BOOL __inline_Thread_WaitCondition(void * __arg1, void * __arg2, APTR __ThreadBase)
{
    return AROS_LC2(BOOL, WaitCondition,
        AROS_LCA(void *,(__arg1),A0),
        AROS_LCA(void *,(__arg2),A1),
        struct Library *, (__ThreadBase), 17, Thread    );
}

#define WaitCondition(arg1, arg2) \
    __inline_Thread_WaitCondition((arg1), (arg2), (APTR)ThreadBase)

static inline void __inline_Thread_SignalCondition(void * __arg1, APTR __ThreadBase)
{
    AROS_LC1NR(void, SignalCondition,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 18, Thread    );
}

#define SignalCondition(arg1) \
    __inline_Thread_SignalCondition((arg1), (APTR)ThreadBase)

static inline void __inline_Thread_BroadcastCondition(void * __arg1, APTR __ThreadBase)
{
    AROS_LC1NR(void, BroadcastCondition,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 19, Thread    );
}

#define BroadcastCondition(arg1) \
    __inline_Thread_BroadcastCondition((arg1), (APTR)ThreadBase)

static inline void __inline_Thread_ExitThread(void * __arg1, APTR __ThreadBase)
{
    AROS_LC1NR(void, ExitThread,
        AROS_LCA(void *,(__arg1),A0),
        struct Library *, (__ThreadBase), 20, Thread    );
}

#define ExitThread(arg1) \
    __inline_Thread_ExitThread((arg1), (APTR)ThreadBase)

#endif /* INLINE_THREAD_H*/
