IoTivity-Lite
oc_poll_loop.h File Reference

Default implementation of the main loop using poll. More...

#include "util/oc_features.h"

Functions

bool oc_poll_loop_init (void)
 Initialize handles. More...
 
bool oc_poll_loop_is_terminated (void)
 Check if the main loop has been terminated. More...
 
void oc_poll_loop_run (void)
 Run the main loop until termination. More...
 
void oc_poll_loop_shutdown (void)
 Shutdown handles. More...
 
void oc_poll_loop_signal (void)
 Signal the main loop to wake up and process events. More...
 
void oc_poll_loop_terminate (void)
 Terminate the main loop. More...
 

Detailed Description

Default implementation of the main loop using poll.

Uses eventfd on Linux and Android, anonymous pipe on other POSIX systems, unnamed event object with WaitForSingleObject on Windows.

Warning
If your application creates additional threads and needs further synchronization, you must implement your own main loop.

Function Documentation

◆ oc_poll_loop_init()

bool oc_poll_loop_init ( void  )

Initialize handles.

◆ oc_poll_loop_is_terminated()

bool oc_poll_loop_is_terminated ( void  )

Check if the main loop has been terminated.

◆ oc_poll_loop_run()

void oc_poll_loop_run ( void  )

Run the main loop until termination.

◆ oc_poll_loop_shutdown()

void oc_poll_loop_shutdown ( void  )

Shutdown handles.

◆ oc_poll_loop_signal()

void oc_poll_loop_signal ( void  )

Signal the main loop to wake up and process events.

◆ oc_poll_loop_terminate()

void oc_poll_loop_terminate ( void  )

Terminate the main loop.