threadapi.h

This module implements support for creating new threads, terminating threads and sleeping threads.

Includes

#include "azure_macro_utils/macro_utils.h"
#include "umock_c/umock_c_prod.h"

Detailed Description

Functions

Function Name Description
THREADAPI_RESULTStrings
THREADAPI_RESULT_FromString
ThreadAPI_Create Creates a thread with the entry point specified by the func argument.
ThreadAPI_Join Blocks the calling thread by waiting on the thread identified by the threadHandle argument to complete.
ThreadAPI_Exit This function is called by a thread when the thread exits.
ThreadAPI_Sleep Sleeps the current thread for the given number of milliseconds.

Macro definitions

THREADAPI_RESULT_VALUES

#define THREADAPI_RESULT_VALUES \
        THREADAPI_OK, \
        THREADAPI_INVALID_ARG, \
        THREADAPI_NO_MEMORY, \
        THREADAPI_ERROR 

Enumeration types

THREADAPI_RESULT

Enumeration specifying the possible return values for the APIs in this module.

enum THREADAPI_RESULT {
  THREADAPI_RESULT_INVALID,
  THREADAPI_OK,
  THREADAPI_INVALID_ARG,
  THREADAPI_NO_MEMORY,
  THREADAPI_ERROR
}

Type definitions

THREAD_START_FUNC

typedef int(* THREAD_START_FUNC) (
  void *  
);

THREAD_HANDLE

typedef void* THREAD_HANDLE;