File Thread.c

FileList > core > Thread.c

Go to the source code of this file

  • #include "Thread.h"
  • #include "AssertLib.h"
  • #include <sys/syscall.h>

Public Functions

Type Name
void DestroyMutex (CrossPlatformMutex * pMtx)
CrossPlatformThreadID GetThisThreadsID ()
void InitMutex (CrossPlatformMutex * pMtx)
void JoinThread (CrossPlatformThread pThread)
void LockMutex (CrossPlatformMutex * pMtx)
void SleepForMS (int ms)
Make the calling thread sleep for ms milliseconds.
CrossPlatformThread StartThread (ThreadFn thread, void * pUser)
Thread functions have return values as required by the OS thread libs but as the win32 thead returns a dword (32bit) and the pthread returns a void* (64 bit), so our abstraction just ignores return values.
void UnlockMutex (CrossPlatformMutex * pMtx)

Public Functions Documentation

function DestroyMutex

void DestroyMutex (
    CrossPlatformMutex * pMtx
) 

Parameters:

  • pMtx

function GetThisThreadsID

CrossPlatformThreadID GetThisThreadsID () 

Returns:


function InitMutex

void InitMutex (
    CrossPlatformMutex * pMtx
) 

Parameters:

  • pMtx

function JoinThread

void JoinThread (
    CrossPlatformThread pThread
) 

function LockMutex

void LockMutex (
    CrossPlatformMutex * pMtx
) 

Parameters:

  • pMtx

function SleepForMS

Make the calling thread sleep for ms milliseconds.

void SleepForMS (
    int ms
) 

Parameters:

  • ms

function StartThread

Thread functions have return values as required by the OS thread libs but as the win32 thead returns a dword (32bit) and the pthread returns a void* (64 bit), so our abstraction just ignores return values.

CrossPlatformThread StartThread (
    ThreadFn thread,
    void * pUser
) 

Parameters:

  • thread
  • pUser

Returns:


function UnlockMutex

void UnlockMutex (
    CrossPlatformMutex * pMtx
) 

Parameters:

  • pMtx


The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/src/core/Thread.c