Open Files 5.3.0
Multi-Platform Event-Driven Application Framework
waitset.h File Reference
#include "ofc/core.h"
#include "ofc/types.h"
#include "ofc/handle.h"
Include dependency graph for waitset.h:

Go to the source code of this file.

Data Structures

struct  WAIT_SET
 

Functions

OFC_CORE_LIB OFC_HANDLE ofc_waitset_create (OFC_VOID)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_destroy (OFC_HANDLE handle)
 
OFC_CORE_LIB OFC_HANDLE ofc_waitset_wait (OFC_HANDLE handle)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_wake (OFC_HANDLE handle)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_add (OFC_HANDLE hSet, OFC_HANDLE hApp, OFC_HANDLE hEvent)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_remove (OFC_HANDLE hSet, OFC_HANDLE hEvent)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_clear (OFC_HANDLE handle)
 
OFC_CORE_LIB OFC_VOID ofc_waitset_clear_app (OFC_HANDLE handle, OFC_HANDLE hApp)
 

Function Documentation

◆ ofc_waitset_add()

OFC_CORE_LIB OFC_VOID ofc_waitset_add ( OFC_HANDLE  hSet,
OFC_HANDLE  hApp,
OFC_HANDLE  hEvent 
)

Add an event to the wait set

Parameters
hSetHandle to the wait set to add the event to
hAppHandle to the app that owns the event
hEventHandle to the event to add
Examples
smbcp.c, and test_file.c.

◆ ofc_waitset_clear()

OFC_CORE_LIB OFC_VOID ofc_waitset_clear ( OFC_HANDLE  handle)

Remove all events from a wait set

Parameters
handleHandle to wait set

◆ ofc_waitset_clear_app()

OFC_CORE_LIB OFC_VOID ofc_waitset_clear_app ( OFC_HANDLE  handle,
OFC_HANDLE  hApp 
)

Disassociate an app from all events in waitset

Parameters
handleHandle to the waitset
hAppApp to disassociate

◆ ofc_waitset_create()

OFC_CORE_LIB OFC_HANDLE ofc_waitset_create ( OFC_VOID  )

Create a wait set

A Wait Set is just a container that events are added to. Events are specified as handles. Multiple events can be added and a subsequent wait will wait for any one of the events to be triggered.

Returns
A handle to the wait set
Examples
smbcp.c, and test_file.c.

◆ ofc_waitset_destroy()

OFC_CORE_LIB OFC_VOID ofc_waitset_destroy ( OFC_HANDLE  handle)

Destroy a wait set

Parameters
handleHandle of the wait set to destroy
Examples
smbcp.c, and test_file.c.

◆ ofc_waitset_remove()

OFC_CORE_LIB OFC_VOID ofc_waitset_remove ( OFC_HANDLE  hSet,
OFC_HANDLE  hEvent 
)

Remove an event from a wait set

Parameters
hSetHandle to wait set
hEventHandle to event to remove
Examples
smbcp.c, and test_file.c.

◆ ofc_waitset_wait()

OFC_CORE_LIB OFC_HANDLE ofc_waitset_wait ( OFC_HANDLE  handle)

Wait for an event in a wait set to be ready

Parameters
handleHandle of the wait set to wait on
Returns
Handle to the app with the event that is ready. OFC_HANDLE_NULL if woken by a wake call.
Examples
smbcp.c, and test_file.c.

◆ ofc_waitset_wake()

OFC_CORE_LIB OFC_VOID ofc_waitset_wake ( OFC_HANDLE  handle)

Wake up a wait set that is currently waiting.

Parameters
handleHandle of the wait set to wake up.