logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

include/Zycore/API/Thread.h

Author

       Generated automatically by Doxygen for Zycore from the source code.

Zycore                                           Version 1.5.2.0                  include/Zycore/API/Thread.h(3)

Function Documentation

ZYCORE_EXPORTZyanStatusZyanThreadGetCurrentThread(ZyanThread*thread)
       Returns the handle of the current thread.

       Parametersthread Receives the handle of the current thread.

       Returns
           A zyan status code.

   ZYCORE_EXPORTZyanStatusZyanThreadGetCurrentThreadId(ZyanThreadId*thread_id)
       Returns the unique id of the current thread.

       Parametersthread_id Receives the unique id of the current thread.

       Returns
           A zyan status code.

   ZYCORE_EXPORTZyanStatusZyanThreadTlsAlloc(ZyanThreadTlsIndex*index,ZyanThreadTlsCallbackdestructor)
       Allocates a new Thread Local Storage (TLS) slot.

       Parametersindex Receives the TLS slot index.
           destructor A pointer to a destructor callback which is invoked to finalize the data in the TLS slot
           or ZYAN_NULL, if not needed.

       The maximum available number of TLS slots is implementation specific and different on each platform:

       • Windows

         • A total amount of 128 slots per process are guaranteed

       • POSIX

         • A total amount of 128 slots per process are guaranteed

         • Some systems guarantee larger amounts like e.g. 1024 slots per process

       Note  that  the invocation rules for the destructor callback are implementation specific and different on
       each platform:

       • Windows

         • The callback is invoked when a thread exits

         • The callback is invoked when the process exits

         • The callback is invoked when the TLS slot is released

       • POSIX

         • The callback is invoked when a thread exits and the stored value is not null

         • The callback is NOT invoked when the process exits

         • The callback is NOT invoked when the TLS slot is released

       Returns
           A zyan status code.

   ZYCORE_EXPORTZyanStatusZyanThreadTlsFree(ZyanThreadTlsIndexindex)
       Releases a Thread Local Storage (TLS) slot.

       Parametersindex The TLS slot index.

       Returns
           A zyan status code.

   ZYCORE_EXPORTZyanStatusZyanThreadTlsGetValue(ZyanThreadTlsIndexindex,void**data)
       Returns the value inside the given Thread Local Storage (TLS) slot for the calling thread.

       Parametersindex The TLS slot index.
           data Receives the value inside the given Thread Local Storage (TLS) slot for the calling thread.

       Returns
           A zyan status code.

   ZYCORE_EXPORTZyanStatusZyanThreadTlsSetValue(ZyanThreadTlsIndexindex,void*data)
       Set the value of the given Thread Local Storage (TLS) slot for the calling thread.

       Parametersindex The TLS slot index.
           data The value to store inside the given Thread Local Storage (TLS) slot for the calling thread

       Returns
           A zyan status code.

Name

       include/Zycore/API/Thread.h

Synopsis

       #include <Zycore/Defines.h>
       #include <Zycore/Status.h>

   FunctionsZYCORE_EXPORTZyanStatusZyanThreadGetCurrentThread (ZyanThread *thread)
       ZYCORE_EXPORTZyanStatusZyanThreadGetCurrentThreadId (ZyanThreadId *thread_id)
       ZYCORE_EXPORTZyanStatusZyanThreadTlsAlloc (ZyanThreadTlsIndex *index, ZyanThreadTlsCallback destructor)
       ZYCORE_EXPORTZyanStatusZyanThreadTlsFree (ZyanThreadTlsIndex index)
       ZYCORE_EXPORTZyanStatusZyanThreadTlsGetValue (ZyanThreadTlsIndex index, void **data)
       ZYCORE_EXPORTZyanStatusZyanThreadTlsSetValue (ZyanThreadTlsIndex index, void *data)

See Also