class Poco::ThreadImpl

#include <Thread_POSIX.h>

class ThreadImpl
{
public:
    // typedefs

    typedef pthread_t TIDImpl;
    typedef int TIDImpl;
    typedef unsigned(__stdcall* Entry)(void *);
    typedef DWORD TIDImpl;
    typedef void (*Callable)(void *);
    typedef DWORD(WINAPI* Entry)(LPVOID);

    // enums

    enum
    {
        DEFAULT_THREAD_STACK_SIZE = 65536,
    };

    enum Policy;
    enum Priority;

    // structs

    struct CallbackData;
    struct ThreadData;

    // classes

    class CurrentThreadHolder;

    // methods

    TIDImpl
    tidImpl() const;

    void
    setOSPriorityImpl(
        int prio,
        int policy = SCHED_OTHER
        );

    void
    startImpl(Runnable& target);

    void
    startImpl(
        Callable target,
        void* pData = 0
        );

    TIDImpl
    tidImpl() const;

    void
    setPriorityImpl(int prio);

    int
    getPriorityImpl() const;

    void
    setOSPriorityImpl(
        int prio,
        int policy = 0
        );

    int
    getOSPriorityImpl() const;

    void
    setStackSizeImpl(int size);

    int
    getStackSizeImpl() const;

    void
    startImpl(SharedPtr<Runnable> pTarget);

    void
    joinImpl();

    bool
    joinImpl(long milliseconds);

    bool
    isRunningImpl() const;

    static
    int
    getMinOSPriorityImpl(int policy);

    static
    int
    getMaxOSPriorityImpl(int policy);

    static
    void
    sleepImpl(long milliseconds);

    static
    void
    yieldImpl();

    static
    int
    getMinOSPriorityImpl(int policy);

    static
    int
    getMaxOSPriorityImpl(int policy);

    static
    void
    sleepImpl(long milliseconds);

    static
    void
    yieldImpl();

    static
    ThreadImpl*
    currentImpl();

    static
    TIDImpl
    currentTidImpl();

protected:
    // methods

    static
    void*
    runnableEntry(void* pThread);

    static
    int
    mapPrio(
        int prio,
        int policy = SCHED_OTHER
        );

    static
    int
    reverseMapPrio(
        int osPrio,
        int policy = SCHED_OTHER
        );

    static
    void
    runnableEntry(
        void* pThread,
        int,
        int,
        int,
        int,
        int,
        int,
        int,
        int,
        int
        );

    static
    void
    callableEntry(
        void* pThread,
        int,
        int,
        int,
        int,
        int,
        int,
        int,
        int,
        int
        );

    static
    int
    mapPrio(int prio);

    static
    int
    reverseMapPrio(int osPrio);

    static
    unsigned __stdcall
    runnableEntry(void* pThread);

    static
    DWORD WINAPI
    runnableEntry(LPVOID pThread);

    void
    createImpl(
        Entry ent,
        void* pData
        );

    void
    threadCleanup();
};

// direct descendants

class Thread;