C Porting Layer API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E80003-19
iotcs_port_thread.h File Reference

The file contains porting layer for threads. More...

#include <stdint.h>
#include "iotcs_config.h"

Go to the source code of this file.

Typedefs

typedef void *(* iotcs_port_thread_func )(void *)
 pointer to thread function.
typedef void * iotcs_port_thread
 thread handle.

Functions

iotcs_port_thread iotcs_port_thread_create (iotcs_port_thread_func func_ptr)
 Creates and starts iotcs_port_thread instance.
iotcs_port_thread iotcs_port_thread_create_small_stack (iotcs_port_thread_func func_ptr)
 Creates and starts iotcs_port_thread instance small stack size.
void iotcs_port_thread_join (iotcs_port_thread thread)
 Joins iotcs_port_thread instance If a thread is NULL, no operation is performed.
int iotcs_port_sleep_millis (int32_t timeout_ms)
 Puts current thread into sleep for a given time.
void iotcs_port_thread_cleanup (void)
 Releases memory that was allocated automatically for new threads Called in thread context before thread finish execution.

Detailed Description

The file contains porting layer for threads.


Function Documentation

int iotcs_port_sleep_millis ( int32_t  timeout_ms)

Puts current thread into sleep for a given time.

Note:
Optional API. Called by the Library if IOTCS_MESSAGING_THREAD_SAFETY option is defined.
Parameters:
timeout_msan interval in milliseconds
void iotcs_port_thread_cleanup ( void  )

Releases memory that was allocated automatically for new threads Called in thread context before thread finish execution.

This could be used to release automatically allocated thread local resources, like openSSL does. In most cases this method could be NO-OP.

Note:
Optional API. Called by the Library if IOTCS_MESSAGING_THREAD_SAFETY option is defined.
iotcs_port_thread iotcs_port_thread_create ( iotcs_port_thread_func  func_ptr)

Creates and starts iotcs_port_thread instance.

Note:
Optional API. Called by the Library if IOTCS_MESSAGING_THREAD_SAFETY option is defined.
Parameters:
func_threadfunction
Returns:
iotcs_port_thread on success
NULL if failed
iotcs_port_thread iotcs_port_thread_create_small_stack ( iotcs_port_thread_func  func_ptr)

Creates and starts iotcs_port_thread instance small stack size.

Note:
Optional API. Called by the Library if IOTCS_MESSAGING_THREAD_SAFETY option is defined.
Parameters:
func_threadfunction
Returns:
iotcs_port_thread on success
NULL if failed
void iotcs_port_thread_join ( iotcs_port_thread  thread)

Joins iotcs_port_thread instance If a thread is NULL, no operation is performed.

Note:
Optional API. Called by the Library if IOTCS_MESSAGING_THREAD_SAFETY option is defined.
Parameters:
threada thread handle